SAS批量导出sas7bdata至excel

/*创建输出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;
posted @ 2016-11-08 12:54  zzwhu  阅读(2289)  评论(0编辑  收藏  举报