yzzhang 发表于 2010-5-29 11:34 
对于数据步和过程步的编译和执行可以理解,但是对宏的编译和执行一直搞不清?
%str和%quote好像说一个是在编译时起作用,一个是运行时起作用,但是没弄明白,望版上牛人指点迷津!多谢了!
Here is a simple example to illustrated the difference.
The %str will hide the resoled value of op (=) in compiling process but not in executing process.
The %quote will hide it in both process -- that results in excution error.
%macro test(op);
%if 7 %str(&op) 6 %then %put 1;
%else %put 0;
%mend;
%test(=)
%macro test2(op);
%if 7 %quote(&op) 7 %then %put 1;
%else %put 0;
%mend;
%test2(=)