使用SAS 批量修改文件名
%macro renamefile(inpath=,inext=,outpath=,outext=);
%if %length(&outext)=0 %then %let outext=&inext;
%if %length(&outpath)=0 %then %let outpath=&inpath;
options noxwait;
filename xxx pipe “dir/b “”&inpath*.&inext”;
data lognames;
infile xxx length=reclen;
input @1 filename $varying2000. reclen;
rc=system(catx(’ “”’,’“copy’,catx(’’,”&inpath",filename),catx(’’,"&outpath",tranwrd(filename,".&inext",".&outext"))));
run;
filename xxx clear;
%mend renamefile;