w*******n 发帖数: 469 | 1 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
为什么不是B? |
A*******s 发帖数: 3942 | 2 %let 和 call symput的差别
【在 w*******n 的大作中提到】 : 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;
|
w*******n 发帖数: 469 | |
A*******s 发帖数: 3942 | 4 非牛人解释一下
%let statement is processed by the macro processor before data step is
executed.
macro processor first scans "%let rc = high" and assigns "high" to rc; Then
scans "%let rc = low" and assigns "low" to rc. No matter what data step does
later on, rc's value is fixed.
To change the value in a macro variable in data step, you need to use call
symput.
【在 w*******n 的大作中提到】 : 不懂啊, 牛人再解释的详细点儿?
|