BookmarkSubscribeRSS Feed
elsfy
Quartz | Level 8

Hi,

 

Do you know if it's possible to add two blank sheets before exporting SAS outputs ? 

I found that it is possible to add one before and after a sheet in which there is a SAS table, or one between two different sheets containing SAS outputs. I want to know if it is possible to add two blank sheets consecutively.

 

I did this 


%macro reporting(...) ; proc report data = ... ; run ; %mend ;
ods excel file = ""
options (sheet_interval="none" blank_sheet="INFORMATION") ;
 ods excel options(sheet_name="A" blank_sheet="INFORMATION_A") ;
%reporting(...) ;
...

 Yet it only outputs two sheets : "INFORMATION_A" and "A" while i want 3 sheets in this order : INFORMATION, INFORMATION_A, A

 

Thanks

2 REPLIES 2
JOL
SAS Employee JOL
SAS Employee

It appears only one blank sheet can be added before your data sheet, but here's a work around you can try, add an extra ods options statement.

 

ods excel file="c:\temp\file.xlsx"
options (sheet_name="A" blank_sheet="Information_A");

proc print data = sashelp.class;
run;

ods excel options (blank_sheet="Information");
ods excel close;

Ksharp
Super User

Try this one :

 

ods excel file="c:\temp\file.xlsx" options (sheet_name="A" );

proc print data = sashelp.class;
run;

ods excel options (sheet_name="BlankSheet1");
proc sql;
select name label='#' from sashelp.class(obs=0);
quit;

ods excel options (sheet_name="BlankSheet2");
proc sql;
select name label='#' from sashelp.class(obs=0);
quit;
ods excel close;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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
  • 1056 views
  • 0 likes
  • 3 in conversation