t*******8 发帖数: 170 | 1 Item 29
The following SAS program is sumbitted:
data WORK.INFO;
infile 'DATAFILE.TXT';
input @1 Company $20. @25 State $2. @;
if State=' ' then input @30 Year;
else input @30 City Year;
input NumEmployees;
run;
How many raw data records are read during each iteration of the DATA step?
A. 1 B. 2 C. 3 D. 4
我看到@的用法:(trailing @) prevents SAS from automatically reading a new
data record into the input buffer when a new INPUT statement is executed
within the same iter |
b******e 发帖数: 539 | 2 这里有很多个input,有的是以@结尾的,有的不是:
第一个input statement ("input @1 Company $20. @25 State $2. @;") 是以@结尾的
,所以第二个input statement ("input @30 Year;"或是"input @30 City Year; ")
继续处理同一个record.但这个不是以@结尾的,所以第三个input statement处理的是下
一个record. |
o*********h 发帖数: 6 | 3 The answer B is correct since there is another input statement after the "if
else".
【在 t*******8 的大作中提到】 : Item 29 : The following SAS program is sumbitted: : data WORK.INFO; : infile 'DATAFILE.TXT'; : input @1 Company $20. @25 State $2. @; : if State=' ' then input @30 Year; : else input @30 City Year; : input NumEmployees; : run; : How many raw data records are read during each iteration of the DATA step?
|
t*******8 发帖数: 170 | 4 多谢多谢这么详细的解释!
【在 b******e 的大作中提到】 : 这里有很多个input,有的是以@结尾的,有的不是: : 第一个input statement ("input @1 Company $20. @25 State $2. @;") 是以@结尾的 : ,所以第二个input statement ("input @30 Year;"或是"input @30 City Year; ") : 继续处理同一个record.但这个不是以@结尾的,所以第三个input statement处理的是下 : 一个record.
|
t*******8 发帖数: 170 | 5 多谢多谢!已经明白了。
if
【在 o*********h 的大作中提到】 : The answer B is correct since there is another input statement after the "if : else".
|