2月 14, 2011

Posted in | 1 条评论

SAS macro symbol table(2):特殊规则

上篇对macro symbol table的常规应用进行了简单的梳理,本篇对如call symput的非宏语言在建立宏变量时symbol table的特殊规则进行梳理。

1.the into : operator in PROC SQL

“into :”算符并不不属于宏语言,但是其定义宏变量的过程基本与使用%let相同:先由当前local,再向上级直到global中搜寻所定义的宏变量是否存在,再进行相应的处里。参见SAS macro symbol table(1)

style=”text-align: center;”>需要了解的是,在proc sql执行过程中,会自动产生三个包含该proc sql过程信息的宏变量:sqlobs、sqlrc和sqloops,如下:

  • SQLOBS: set to the number of rows produced with a SELECT statement.
  • SQLRC: set to the return code from an SQL statement.
  • SQLOOPS: set to the number of iterations of the inner loop of PROC SQL.

合理的使用以上三个宏变量,对程序的编写可以起到很好的作用。

继续阅读
返回顶部