1.Consider the following data step:
data WORK.NEW;
set WORK.OLD;
Count+1;
run;
The variable Count is created using a sum statement. Whichstatement regarding this variable is true?
A.It is assigned a value 0 when the data step begins execution.
B.It is assigned a value of missing when the data step begins execution.
C.It is assigned a value 0 at compile time.
D.It is assigned a value of missing at compile time.
(我选C)
29.The following SAS program issumbitted:
data WORK.INFO;
infile 'DATAFILE.TXT';
input @1 Company 20.@25State2. @;
if State=' ' then input @30 Year;
else input @30 City Year;
input NumEmployees;
run;
How many raw data records areread during each iteration of the DATA step?
A. 1
B. 2
C. 3
D. 4
我选B
第一题 Count+1; 等价于 retain count 0,count+1;所以一开始count=0 所以选C
第二题由于input @1 Company 20.@25State2. @;
if State=' ' then input @30 Year;
else input @30 City Year; 没有@ 所以之后input读新的一行 (但是此处疑惑的是
不过对于if ...then; else...中也有两个input statemens, 第一个被@ hold住了没有跳行那么第二个也可以被hold住吗,会不会选C?????)
欢迎大家讨论