嗨,我有一个简单的问题,但是我发现的所有响应都非常复杂,我在宏中有一个要引用的文件名列表,以便在此处导入所有文件,< / p>
%let y20 = Jan20 Feb20;
%macro boucle_doCC(in);
proc import datafile ="&rep.\&in..xlsx"
out=&in
dbms=xlsx replace;
getnames=yes;
run;
%end;
%mend boucle_doCC;
我知道在proc导入之前我需要执行do循环,但是我不知道该怎么做,您能帮忙吗?
答案 0 :(得分:0)
data files;
input file $;
datalines;
Jan20
Feb20
;
%macro boucle_doCC(in=,rep=/*repository here*/);
proc import datafile ="&rep.\&in..xlsx"
out=&in
dbms=xlsx
replace;
getnames=yes;
run;
%mend boucle_doCC;
data _null_;
set files;
call symputx('file',file);
call execute('%boucle_doCC(in='||file||');');
run;