d******9 发帖数: 404 | 1 使用 call symput to create macro variables, the created macro variables can
NOT be referenced in the same data step, for example:
Data B;
Set A;
Call symput(X, Name);
Run;
We can only refer to use X in the following data step or Proc, but not in the same step.
However, what about Proc SQL INTO clause?
I run the below codes on SAS 9.1:
Proc sql;
select count(*) into: N
from aaa;
%let Y=&N;
%put ***************;
%put N=*&N*;
%put Y=*&Y*;
quit;
It turned out that both N and Y are resolved without any problem.So, I am puzzled. My question is:
Usually, macro processing will undergo before open codes. If so, the macro
statements %let Y=&N, %put etc are supposed to be executed before the
creation of N by INTO. However, they turned out to be not.
请达人解释一下 Select INTO 产生 macro variable 的机理。是在compile 阶段,还
是执行阶段????????
多谢。 | d******9 发帖数: 404 | | d*******o 发帖数: 493 | 3 macro variable和marco不是同一个概念。macro是需要编译和执行的。macro variable
是寄存在内存里的变量 | d******9 发帖数: 404 | 4 To the point! More details, please
variable
【在 d*******o 的大作中提到】 : macro variable和marco不是同一个概念。macro是需要编译和执行的。macro variable : 是寄存在内存里的变量
|
|