全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2114 1
2007-07-11
为什么A不对?


Suppose that the Sasuser.Revenue data set has a simple index named FlightID. For which of the following programs will the index be used?

a.
proc print data=sasuser.revenue;
where flightid ne 'IA11200';
run;
b.
data someflights;
set sasuser.revenue;
where flightid > 'IA11200';
run;
c.
data someflights;
set sasuser.revenue;
if flightid > 'IA11200';
run;
d.
proc print data=sasuser.revenue;
where origin='RDU' or flightid='IA03400';
run;

Correct answer:

复制代码
b


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2007-7-11 23:15:00

回复:(mxqy)[求助]ADV 试题一道

It's a confusing question.

I think, if dataset has many obs (say 100 or more, actually, Sasuser.Revenue has 142 obs, but we can't think this particular dataset, should be general, right?), using 'ne', SAS needs to process more obs then this specifical one 'IA11200' , so not effienct?

But, on the other hand, if 'IA11200' is the smallest one in the dataset, so where flightid > 'IA11200' is similar to where flightid ne 'IA11200', right? Both answer A and B are not correct? no answer for this question.

The explanation from the answer also confusing, did not mention A either:

An index can improve the efficiency with which SAS is able to access certain observations in a data set. However, an index is not always useful. SAS will not use an index to process subsetting IF statements, or other statements that SAS determines might be more efficiently processed without an index.

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群