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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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