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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.