I use SAS to create 3 data sets. then I use PROC PRINT per the code below to create 3 excel files which show their data. Is there anyway to make a statement that puts all 3 data sets as diffferent tabs in the same excel file???
ods excel file='D:\qsilver\SAS Data\BZ\3_Output\TotalOutput5k.xlsx' style=meadows;
Proc print data=work.histodata_Total noobs label;
run;
ods excel close;
ods excel file='D:\qsilver\SAS Data\BZ\3_Output\RefiOutput5k.xlsx' style=meadows;
Proc print data=work.histodata_refi noobs label;
run;
ods excel close;
ods excel file='D:\qsilver\SAS Data\BZ\3_Output\PurchaseOutput5k.xlsx' style=meadows;
Proc print data=work.histodata_purchase noobs label;
run;
ods excel close;
One way is via the XLSX engine:
libname xlout XLSX 'D:\qsilver\SAS Data\BZ\3_Output\Output5k.xlsx'; data xlout.Total; set work.histodata_Total; run; data xlout.Refi; set work.histodata_Refi; run; data xlout.Purchase; set work.histodata_Purchase; run; libname xlout clear;
See Chris' blog post for more details: Using LIBNAME XLSX to read and write Excel files
One way is via the XLSX engine:
libname xlout XLSX 'D:\qsilver\SAS Data\BZ\3_Output\Output5k.xlsx'; data xlout.Total; set work.histodata_Total; run; data xlout.Refi; set work.histodata_Refi; run; data xlout.Purchase; set work.histodata_Purchase; run; libname xlout clear;
See Chris' blog post for more details: Using LIBNAME XLSX to read and write Excel files
Genius! Exactly what I needed, thank you!!!
![]()
![]()
![]()
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.