|
楼主
楼主 |
发表于 2003-12-19 09:07:16
|
只看该作者
例子:宏变量的拼接和引用
例子:
程序是这样的:
%let zd001=coilno as m_no,
FAANFA204,
FAANFA407_1;
%let zd002=coilno as m_no,
FASLF006;
%let zd003=coilno as m_no,
MCC1F025;
中间略……
%let zd009=coilno as m_no,
MFT1F031_1,
MFT1F031_2,
MFT1F031_3,
MFT1F031_4,
J;
%macro cre00(i);
%do j=1 %to &i;
proc sql;
create table tch100&j
as select &zd00&j from suipc000&j where coilno in (select coilno from tmp0);
quit;
%end;
%mend;
%cre00(9);
这个程序是错误的,&zd00&j的意思取zd00的值与j的值拼在一起。
SAS出现如下出错信息:
NOTE: Line generated by the invoked macro "CRE00".
1 &zd00&j from ipc_1580.suipc000&j where
-
22
1 ! coilno in (select coilno from tmp0); quit;
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
a numeric constant, a datetime constant, a missing value, INPUT, PUT, USER. |
|