DATA Step, Macro, Functions and more

Output/creating multiple excel documents - with preexisting excel template

Reply
Frequent Contributor
Posts: 127

Output/creating multiple excel documents - with preexisting excel template

Dear experts,

 

I have to report my data in 2 excel sheets, therefore I am usinf the option sheet interval = non but how can I move to the next sheet afterwards? I checke the forum and someone mentioned a bug, any news on it? Thanks a lot in advance for your support.

 

ods select all;
ods excel options(
sheet_interval="none"
suppress_bylines="yes"
sheet_label="sheet2"
embedded_titles="yes"
embed_titles_once="yes"
);
ods excel close

%include "W:\04-Programfiles\dashboard\monitoring_S02_claims_as-is_analysis.sas";

ods excel close
;run;

 

Best regards,

SH

Frequent Contributor
Posts: 129

Re: Output/creating multiple excel documents - with preexisting excel template

Posted in reply to Sir_Highbury

IMHO, with sheet_interval=none you can not create multisheet excel files. ODS EXCEL seems not to be as flexible as EXCELXP is, since it doesn't allow to switch or to display 2 tables on sheet and 1 table on the other.

 

Multisheets with one table can be created like this.

ods excel file="c:\example.xlsx"
options(
suppress_bylines="yes"
sheet_label="class"
embedded_titles="yes"
embed_titles_once="yes"
);
proc print data=sashelp.class (obs=5);run;
 
ods excel options(
suppress_bylines="yes"
sheet_label="only cars"
embedded_titles="yes"
embed_titles_once="yes"
);
proc print data=sashelp.cars (obs=5);run;
 
ods excel close;
________________________

- Cheers -

Super User
Posts: 19,772

Re: Output/creating multiple excel documents - with preexisting excel template

@Oligolas You can create multi sheet and control it, but it's buggy right now.

 

Ask a Question
Discussion stats
  • 2 replies
  • 210 views
  • 0 likes
  • 3 in conversation