SAS_Institute
A00-280 · Question #37
Given the following data at WORK.DEMO: PTID Sex Age Height Weight 457892 M 14 69.0 112.5 464289 F 13 66.0 84.0 479004 F 15 65.0 99.0 483476 F 14 62.0 102.5 493067 M 14 63.0 102.0 500029 M 12 60.5…
The correct answer is B. proc print data=WORK.DEMO (obs=5); where Sex='M'; run. See the full explanation below for the reasoning.
Question
Given the following data at WORK.DEMO:
PTID Sex Age Height Weight
457892 M 14 69.0 112.5
464289 F 13 66.0 84.0
479004 F 15 65.0 99.0
483476 F 14 62.0 102.5
493067 M 14 63.0 102.0
500029 M 12 60.5 93.0
513842 F 12 59.8 84.5
515281 F 14 65.5 112.0
522396 M 13 62.5 94.0
534787 M 12 59.0 99.5
541235 F 13 64.3 88.0
546823 F 14 64.3 90.0
556679 F 12 56.1 77.0
560889 F 15 64.5 111.0
578222 M 16 72.0 150.0
635445 M 12 64.8 128.0
Which SAS program prints only the first 5 males in this order from the data set?
Options
- Aproc sort data=WORK.DEMO out=out; By sex; run; proc print data= out (obs=5); run;
- Bproc print data=WORK.DEMO (obs=5); where Sex='M'; run;
- Cproc print data=WORK.DEMO (where=(sex='M')); where obs<=5; run;
- Dproc sort data=WORK.DEMO out=out; by sex descending; run; proc print data= out (obs=5); run;
How the community answered
(58 responses)- A7% (4)
- B72% (42)
- C5% (3)
- D16% (9)
Community Discussion
No community discussion yet for this question.