%macro export_excel;
%do i=1 %to &nummem;
%let tname=%qscan(&memlist,&i,\);
proc export data=rawfile.&tname
outfile='D:\study\datasets.xlsx'
dbms=xlsx
replace label;
sheet="&tname";
quit;
%end;
%mend export_excel;
%export_excel
跑这段代码想打sas数据集转成excel,会报错ERROR: "RAWFILE." is not a valid name.,但是我%put rawfile.&tname的时候是可以rawfile.AE rawfile.BU rawfile.CAT rawfile.CCT rawfile.CM出来的,请问下为什么放在data=rawfile.&tname的时候会认为是把rawfile.当成数据集名字了,&tname在这里没有引用成功吗?