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.
Output on tab 2 — Note that the title appears twice, not what I want
embed_titles_once='ON' seems to fix the problem. I never used that one before. Thanks!
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: