25.Given the following code:
proc print data=SASHELP.CLASS(firstobs=5 obs=15);
where Sex='M';
run;
How many observations will be displayed?
A. 11
B. 15
C. 10 or fewer
D. 11 or fewer
Answer: D
本文属于博客:http://crackman.net/版权归作者所有,欢迎转载!如有转载,请务必注明出处!未经本文作者同意不得用于商业应用。
本题考察的是firstobs以及obs两个参数的作用。
FIRSTOBS:确定读取观测的起始序列号,obs是确定读取观测终止时的序列号。也就是从第五个观测开始,到第15个观测时结束。
从第5和第15之间的数据有11个,第五和第十五的观测序号根据where的筛选后的数据集来确定的,例如,所以答案为D。
看看外文文献的解释:
Use the FIRSTOBS= and OBS= options together to process a set of observations from the middle of a data set. For example, this statement processes only observations 1000 through 1100:
options firstobs=1000 obs=1100;
感谢POBEL的补充!