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
29,B为何是答案?
31. Given the following raw data records in DATAFILE.TXT:
----|----10---|----20---|----30
Kim,Basketball,Golf,Tennis
Bill,Football
Tracy,Soccer,Track
The following program is submitted:
data WORK.SPORTS_INFO;
length Fname Sport1-Sport3 $ 10;
infile 'DATAFILE.TXT' dlm=',';
input Fname $ Sport1 $ Sport2 $ Sport3 $;
run;
proc print data=WORK.SPORTS_INFO;
run;
Which output is correct based on the submitted program?
A. Obs Fname Sport1 Sport2 Sport3
1 Kim Basketball Golf Tennis
2 Bill Football
3 Tracy Soccer Track
B. Obs Fname Sport1 Sport2 Sport3
1 Kim Basketball Golf Tennis
2 Bill Football Football Football
3 Tracy Soccer Track Track
C. Obs Fname Sport1 Sport2 Sport3
1 Kim Basketball Golf Tennis
2 Bill Football Tracy Soccer
D. Obs Fname Sport1 Sport2 Sport3
1 Kim Basketball Golf Tennis
2 Bill Football
31,答案是C,为何不是A?
42.The following SAS program is submitted:
data WORK.ONE;
Text='Australia, US, Denmark';
Pos=find(Text,'US','i',5);
run;
What value will SAS assign to Pos?
"As of SAS 9.4, if the SCAN function returns a value to a variable that has not yet been given a length, that variable is given the length of the first argument".
话说回来,如果该题问的是first 的 value,答案是 A 。