By admin | August 14, 2009

SAS Certified Adv Programmer 50 Questions (22)

The following SAS program is submitted:

%let day=Tuesday;
%macro loop(day);
    %do day=2 %to 6;
        proc print data=sasuser.houses;
            where sellday="&day";
        run;
    %end;
    %put day is &day;
%mend;

%loop(Friday)

Which one of the following is written to the log by the %PUT statement?

a. day is 7
b. day is &day
c. day is Friday
d. day is Tuesday

4 comments | Add One

  1. admin - 08/14/2009 at 1:30 pm

    A

  2. Blaiso - 05/31/2013 at 11:26 pm

    A the put statement is executed when the value of the macro variable day is 7

  3. Max - 10/15/2013 at 7:44 pm

    I don’t get it. Why is it not d) day is Tuesday?

    Isn’t:

    %put day is &day; => day is Tuesday
    %put day is &Friday; => day is 7

  4. chinawokee - 07/10/2014 at 4:09 pm

    any variable that is created within a macro definition is a macro variable too?

Leave a Comment

Leave a Reply

Your email address will not be published.