Boa tarde,
tenho duas tabelas e gostaria de gerar/exportar um arquivo único, em que, cada tabela ficasse em uma aba do excel.
Como fazer este procedimento?
ods excel file="myexcelfile.xlsx" options(sheet_name='Table 1');
proc print data=table1;
run;
ods excel options(sheet_name='Table 2');
proc print data=table2;
run;
ods excel close;
Try creating the Excel file in a folder where you do have write permission/access.
Use an absolute path (starts with a drive letter or backslash in Windows, or at root in UNIX) which points to a location where you have write permission.
if you just need it temporarily (e.g. to attach the file to email), you can use the WORK location:
%let loc = %sysfunc(pathname(work));
ods excel file="&loc./myexcelfile.xlsx" options(sheet_name='Table 1');
/* rest of code */
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 save with the early bird rate—just $795!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.