BookmarkSubscribeRSS Feed
Lucasmarques94
Calcite | Level 5

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?

4 REPLIES 4
PaigeMiller
Diamond | Level 26
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;
--
Paige Miller
Lucasmarques94
Calcite | Level 5
Está aparecendo o seguinte erro: ERROR insuficiente authorization to access
PaigeMiller
Diamond | Level 26

Try creating the Excel file in a folder where you do have write permission/access.

--
Paige Miller
Kurt_Bremser
Super User

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 */

SAS Innovate 2025: Call for Content

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!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 603 views
  • 0 likes
  • 3 in conversation