By admin | August 16, 2009

SAS Certified Adv Programmer 50 Questions (26)

The following SAS program is submitted:

%let mvar=bye;
data _null_;
    var1='hi';
    var2='hello';
    call symput('var1' || "&mvar", var2);
run;

Which one of the following is the name of the macro variable created by the CALL SYMPUT statement?

a. var1
b. hibye
c. var1bye
d. No macro variable is created because the CALL SYMPUT statement is not valid.

By admin | August 14, 2009

SAS Certified Adv Programmer 50 Questions (25)

Which one of the following is the purpose of the %STR function?

a. to extract part of a macro character value
b. to treat semicolons and other selected tokens as text
c. to concatenate the values of two macro variables into one
d. to extract part of a macro variable based on matching criteria

By admin | August 14, 2009

SAS Certified Adv Programmer 50 Questions (24)

The following SAS program is submitted:

%let type=RANCH;
proc sql;
    create view houses as
        select *
            from sasuser.houses
            where style="&type";
quit;
%let type=CONDO;
proc print data=houses;
run;

The report that is produced displays observations whose value of Style are all equal to RANCH. Which one of the following functions on the WHERE clause resolves the current value of the macro variable type?

a. GET
b. SYMGET
c. %SYMGET
d. &RETRIEVE

By admin | August 14, 2009

SAS Certified Adv Programmer 50 Questions (23)

Which of the following SAS functions retrieves the value of a macro variable during DATA step execution?

a. GET
b. SYMGET
c. %SYMGET
d. &MVARNAME

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