I would like to have piece of code where I can pick data from multiple datasets and load the same into multiple sheets or tabs of one excel file. Please let me know if this is possible using PROC DATASETS. Thanks, Pawan
Hi Pawan,
some one may come with better solution.. Here is the sample Code
/*First sql creating data set name in to macro from work library, if you have in diffrent location change the LIBname*/
proc sql;
select memname into : Ds separated by ' '
from dictionary.columns
where libname='WORK';
quit;
%put &Ds;
%let sqlobs=&sqlobs;
%macro export;
%do i=1 %to &sqlobs;
%let dsn=%scan(&DS,&i);
proc export data=&dsn outfile="\excelpath\sample.xls"
dbms=excel replace;
sheet="&dsn";
run;
%end;
%mend;
%export
Thanks
Sam
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.