By admin | December 16, 2009

SAS Certified Adv Programmer 130 Questions (30)

Given the following SAS data set SASUSER.HIGHWAY:

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 highway;
proc sql noprint;
    select count(distinct status) into:
        numgrp from sasuser.highway;
    %let numgrp = &numgrp;
    select distinct status into:
        group 1- :group&numgrp from sasuser.highway;
quit;

%do i = 1 %to &numgrp;
proc print data = sasuser.highway;
    where status = "&&group&i";
run;
%end;
%mend;

%highway

How many reports are produced by the above program?

A. 0
B. 1
C. 2
D. 5

3 comments | Add One

  1. admin - 12/16/2009 at 10:14 am

    C

  2. Kamal KC - 09/18/2012 at 12:17 am

    Pls provide some explanation about your ans.

  3. Consty - 02/20/2013 at 5:01 pm

    C: because two macro variables group1 and group2 that send to ‘not’ and ‘serious’

Leave a Comment

Leave a Reply

Your email address will not be published.