Thanks rogerjdeangelis, Everything worked except the first three lines (the lines that should delete the excel files). I am on the latest version of SaS. Do you think the code has changed? I am getting the following error: WARNING: Apparent invocation of macro UTLFKIL not resolved. ERROR 180-322: Statement is not valid or it is used out of proper order. WARNING: Apparent invocation of macro UTLFKIL not resolved. 193 %utlfkil(d:/xls/GERMANY.xlsx); - 180 %utlfkil(d:/xls/Canada.xlsx); %utlfkil(d:/xls/GERMANY.xlsx); %utlfkil(d:/xls/USA.xlsx); DATA Have; INPUT Country $ Country_Code Region $; DATALINES; Japan 107 Asia Japan 117 Asia USA 109 America France 103 Europe Canada 111 America India 105 Asia Nepal 115 Asia Italy 102 Europe ; RUN; proc sort data=have out=have; by country; run;quit; %symdel country; data _null_; set have; by country; if first.country then do; call symputx('country',compress(country,' .'),'g'); rc=dosubl(' libname xel "d:/xls/&country..xlsx"; data xel.&country; set have(where=(country="&country")); run;quit; libname xel clear; run;quit; '); end; run;quit;
... View more