BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
PaigeMiller
Diamond | Level 26

I use ODS EXCEL to create some text and plots. I want two tabs in my ODS EXCEL output, that part works fine. You will notice that in the code below, the exact same code is used twice, once before the ods excel options(sheet_interval='NOW'); and then after ods excel options(sheet_interval='NOW');

 

Remember ... exact same code generates the two tabs, but inconsistent titles on the two tabs. Why? How do I fix this?

 

Code:

 

ods excel file="test.xlsx" options(embedded_titles='YES' sheet_interval='NONE');
title "Print of SASHELP.CLASS";
proc print data=sashelp.class(obs=10);
id name;
var age sex height weight;
run;
title;
ods text="^{style [color=black width=100% textalign=l] Footnote goes here}";
proc sgplot data=sashelp.class(obs=10);
scatter x=height y=weight;
run;

ods excel options(sheet_interval='NOW');
title "Print of SASHELP.CLASS";
proc print data=sashelp.class(obs=10);
id name;
var age sex height weight;
run;
title;
ods text="^{style [color=black width=100% textalign=l] Footnote goes here}";
proc sgplot data=sashelp.class(obs=10);
scatter x=height y=weight;
run;
ods excel close;

 

 

Output on tab 1 —  note that the title Print of SASHELP.CLASS appears only at the top, which is what I want.

 

PaigeMiller_0-1661953180877.png

 

 

Output on tab 2 — Note that the title appears twice, not what I want

 

PaigeMiller_1-1661953245173.png

 

--
Paige Miller
1 ACCEPTED SOLUTION

Accepted Solutions
svh
Lapis Lazuli | Level 10 svh
Lapis Lazuli | Level 10
Try this replacement for your first line of code:
ods excel file="test.xlsx" options(embedded_titles='ON' embed_titles_once='ON' sheet_interval='NONE');

View solution in original post

2 REPLIES 2
svh
Lapis Lazuli | Level 10 svh
Lapis Lazuli | Level 10
Try this replacement for your first line of code:
ods excel file="test.xlsx" options(embedded_titles='ON' embed_titles_once='ON' sheet_interval='NONE');
PaigeMiller
Diamond | Level 26

embed_titles_once='ON' seems to fix the problem. I never used that one before. Thanks!

--
Paige Miller

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
  • 410 views
  • 1 like
  • 2 in conversation