/*创建输出excel的宏*/
%macro export(inlib,intbl,outpath,outfile);
proc export data=&inlib..&intbl
outfile= "&outpath\&outfile..xls"
dbms=xls label replace;
putnames=yes;
run;
%mend; %let outpath=F:\excel_files; /*输出excel路径*/
%let inpath=F:\sas7bdata_files;/*sas数据所在路径*/
libname source "&inpath";/*创建逻辑库source*/
data _null_;
set sashelp.vstable (where=(libname='SOURCE'));
call execute(cats('%nrstr(%export)('
,catx(',',libname,memname,'&outpath',memname)
,')'));
run;