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
Solution:
>> The first reading is
input @1 Company $20. @25 State $2. @;
>> The second reading is
input NumEmployees;
Explanations:
For the first reading, the single trailing @ option holds a raw data record in the input buffer until SAS
* executes an INPUT statement with no trailing @, or
* reaches the bottom of the DATA step.