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?????)
歡迎大家討論