My fun solution: Data Tables; Infile datalines; Input Tables :$10.; Datalines; Table1 Table2 Table3 ; Data Ex; Infile datalines; Input Var1 :2.; Datalines; 1 2 3 ; %LET Project=C:\_____\Desktop\ODS Output; Data _NULL_; set Tables end=No_more; call SYMPUTX(CATT('T',_N_),Tables); if no_more THEN CALL SYMPUTX('N',_N_); Run; %MACRO Ex; %Do a=1 %to &N; Libname out XLSX "&Project.\&&T&a...xlsx"; Data out.Data; set ex; Run; Data _NULL_; if (fileexist("&project.\&&T&a...xlsx.bak")) then do; FileRef=filename('d',"&project.\&&T&a...xlsx.bak"); fileref=fdelete('d'); end; Run; Libname out clear; %END; %MEND Ex; %Ex;
... View more