|
楼主
楼主 |
发表于 2003-10-20 17:40:28
|
只看该作者
宏变量的赋值匹配问题
data sam1;
a=1;
run;
data sam2;
b=2;
run;
data sam3;
c=3;
run;
proc sql noprint;
select memname into :tblname separated by '.' from sashelp.vstable
where libname='WORK';
select count(*) into:n from sashelp.vstable
where libname='WORK';
quit;
%macro mac;
%do i=1 %to &n;
%let name1=%scan(&tblname,&i,'.');
%let name2=%substr(&name1,1,3);
%if %trim(&name2)='SAM' %then %put &name1;
%end;
%mend;
%mac;
主要是mac中的%if那行,
也可以使用 %if %trim(%left(&name2))='SAM' ......
不知哪里错了? |
|