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-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1946 views
  • 2 likes
  • 3 in conversation