80. The following SAS program is submitted:
%let rc = Begin;
%macro test;
data out;
set sashelp.prdsale nobs = totalobs;
if totalobs > 10 then do;
%let rc = high;
end;
else do;
%let rc = low;
end;
run;
%mend;
%let rc = Before Execution;
%test
The data set SASHELP.PRDSALE has 50 observations.
What is the value of the variable RC when the macro finishes execution?
A.low
B.high
C.Begin
D.Before Execution
But why don't you run it in sas? You will have a definitive answer. Playing with is the best way to learn it.
----- updated: my previous answer is incorrect. According to sas document, macro variables defined outside of any macro are global. So in this case, the value should be assigned by the last time %let statement is used.
”Since local symbol tables exist separately from the global symbol table, it is possible to have a local macro variable and a global macro variable that have the same name and different values.”