Hi .
I have a library 'mine' in that 6 datasets are there data1-data6..So I need to export only 3 datasets to excel along with the contents dataset for those three also. How to do export using proc export.is there any options or statements to give selected datasets in proc export.
proc export deals with one datset at a time.
If you want to reduce programming create a macro program and supply the dataset names as argument:
%macro xprt(dsnames);
%let n = %sysfunc(countw(&dsnames));
%do i=1 %to &n;
%let dsn = %scan(&dsnames,&i);
proc export data=&dsn ... ;
.... other options ...
run;
%end;
%mend xprt;
%xprt(data1 data3 data4 ...);
You can define, similarly, a list of excell filenames or use a fix prefix with appropriate suffix like XLDATA&i
@sasuser123123 wrote:
Hi .
I have a library 'mine' in that 6 datasets are there data1-data6..So I need to export only 3 datasets to excel along with the contents dataset for those three also. How to do export using proc export.is there any options or statements to give selected datasets in proc export.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.