这很简单,取决于你有一些合理的方法在代码中识别它们.
这是一个简单的答案:
%macro makeCSV(dataset=);
proc export data=&dataset. file="&dataset..csv" dbms=csv replace;
run;
*modify export if needed;
%mend makeCSV;
proc sql;
select cats('%makeCSV(dataset=',memname,')') into :makeCSVlist separated by ' '
from dictionary.tables
where libname='YOURLIB' and memname like 'FORCSV';
quit;
*or whatever logic identifies these 720 or whatnot datasets;
&makeCSVlist; *actually runs the macro calls;
现在,这可能相当慢,但它应该工作.更快的是没有720个数据集,而是一个数据集,并使用FILEVAR =选项在数据步骤中写出代码.如果你有大量的变量(因为你必须编写一个put语句),这会变得有点困难,但即便如此,你也可以生成类似于我刚才使用dictionary.columns的代码.这仍然会生成720个CSV,但速度要快得多,因为它避免了720 proc导出调用及其开销.