data ab; input name$ @@; datalines; a b c d e f g h i j k run; /* above-mentioned observations are sheet names we can link this to our sheet name and dataset name*/ data _null_; set ab nobs=total; call symputx("sheet"||left(_n_),name); call symputx("cnt",total); run; %put &sheet2;/* check it's resovling or not in log*/ %put &cnt; /* check it's resovling or not in log*/ %macro import(); %do i=1 %to &cnt; proc import datafile="G:\SAS Practice\Result\raju.xlsx" out=&&sheet&i dbms=xlsx replace; sheet="&&sheet&i"; run; %end; %mend import; %import();
... View more