http://crackman.net/?p=287
Given the SAS data set SASUSER.HIGHWAY:
Steering Seatbelt Speed Status Count
——– ——– —– ——- —–
absent No 0-29 serious 31
absent No 0-29 not 1419
absent No 30-49 serious 191
absent no 30-49 not 2004
absent no 50+ serious 216
The following SAS program is submitted:
%macro SPLIT;
proc sort
data=SASUSER.HIGHWAY
out=WORK.UNIQUES(keep=Status)
nodupkey;
by Status;
run;
data _null_;
set uniques end=Lastobs;
call symputx(‘Status’||left(_n_),Status);
if Lastobs then call symputx(‘Count’,_n_);
run;
%local i;
data
%do i=1 %to &count;
[_insert_reference_]
%end;
;
set SASUSER.HIGHWAY;
select(Status);
%do i=1 %to &Count;
when(“[_insert_reference_]“) output [_insert_reference_];
%end;
otherwise;
end;
run;
%mend;
%SPLIT
What macro variable reference completes
the program to create the WORK.NOT and
WORK.SERIOUS data sets?
A.
&Status&i
B.
&&Status&i
C.
&Status&Count
D.
&&Status&Count
以上是真题,答案参见博客http://crackman.net/?p=287