新题:
1. 考查两个自动变量的用法:_N_ 和 _Error_。
前者表示data step迭代的次数,所以_N_的值可以是任意正整数,后者_Error_表示是否有错误发生,所以值只能为0(没错误)或1(有错误)。这题机经的答案是
_N_ _Error_
1 1
2 0
3 0
4 1
2. Crackman中的Q35变体,条件语句变为
If x eq .., then .. output groupone;
If y lt .., then .. output grouptwo;
else output groupthree;
所以答案变为
data set groupone has 2 observations
data set grouptwo has 2 observations
data set groupthree has 1 observations
3. Crackman中的Q46 变体, 多了个变量Revenue2007,值为missing,答案不变还是1.6。因为Mean function calculates the arithmetic average of non-missing values.
4. Crackman中的Q51 变题,
proc contents data=_all_;
run;
答案为: The output contains a list of the SAS data sets that are contained in the WORK library and displays the metadata (元数据,描述数据集的数据).