BookmarkSubscribeRSS Feed
bobeng
Obsidian | Level 7

HI I need hellp exporting multiple dataset outputs into one sheet in excel. I am using proc report to output my data.

 

 

2 REPLIES 2
PaigeMiller
Diamond | Level 26

You can direct SAS to output multiple reports to a single sheet in Excel via the ODS EXCEL option SHEET_INTERVAL='NONE'

 

Example:

ods excel file="c:\myfolder\myexcelfile.xlsx" options(sheet_interval='NONE');
proc report data=whatever;
...
run;
proc report data=whatever2;
...
run;
ods excel close;

 Please note: the column widths have to be the same as they are in one Excel sheet. For examplle, if the second column of the first table is wider than the second column of the second table, the Excel file makes the column wide enough for everything, even though that is too wide in the second table.

--
Paige Miller
Cynthia_sas
SAS Super FREQ

Hi:

  ODS EXCEL has a suboption called "sheet_interval" if you want multiple procedure steps (whether multiple PROC REPORTS or a mix of procedures), all you need to do is use the correct suboption. Here's an example:

Cynthia_sas_0-1620745772459.png

 

Cynthia

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

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
  • 2 replies
  • 1376 views
  • 2 likes
  • 3 in conversation