SAS Certified Base Programmer 123 Questions (57)
The SAS data set named WORK.TEST is listed below:
capacity airplanetype staff 150 Large 10
Which one of the following SAS programs created this data set?
A.
data work.test; capacity = 150; if 100 le capacity le 200 then airplanetype = 'Large' and staff = 10; else airplanetype = 'Small' and staff = 5; run;
B.
data work.test; capacity = 150; if 100 le capacity le 200 then do; airplanetype = 'Large'; staff = 10; end; else do; airplanetype = 'Small'; staff = 5; end; run;
C.
data work.test; capacity = 150; if 100 le capacity le 200 then do; airplanetype = 'Large'; staff = 10; else do; airplanetype = 'Small'; staff = 5; end; run;
D.
data work.test; capacity = 150; if 100 le capacity le 200 then; airplanetype = 'Small'; staff = 5; else; airplanetype = 'Large'; staff = 10; run;
Topics:
SAS Base Questions |
3 Comments »
B
options b and c are the same?
for C, the first do clause wasn’t properly closed with end; statement, which will result in error (tested with SAS studio)