Hello
I would like to export multiple reports into Excel XLSX in one sheet.
What is the reason that I cannot see the footnotes?
I also want to add extra space between the two summary report.
ods excel file ="/path/Ex15b.xlsx" style=statistical
options( embedded_titles='yes' embedded_footnotes='yes' );
ods excel options(sheet_interval="NONE" sheet_name="Males");
title "My First Title";
title2 "My Third Title";
proc print data= sashelp.class;
where sex = 'M';
run;
footnote "My First Footnote";
footnote2 "My Third Footnote";
ods excel options(sheet_interval="NONE" sheet_name="Females");
title;
footnote;
title 'RRR';
proc print data= sashelp.class;
where sex = 'F';
run;
ods excel close;
Your FOOTNOTE; statement turns off footnotes before the page is rendered, so you don't see footnotes in your Excel output.
This line is useless, because you aren't starting a new sheet: ods excel options(sheet_interval="NONE" sheet_name="Females");
You may be able to insert blank lines using ODS TEXT.
Hope this helps.
Where is the footnote supposed to appear in this case?
title "My First Title";
title2 "My Third Title";
proc print data= sashelp.class;
where sex = 'M';
run;
footnote "My First Footnote";
footnote2 "My Third Footnote";
The footnotes are defined after that proc print so they will not appear with that procedure output. If these are supposed to appear with the output then the define for the foonotes has to appear prior to the RUN; statement for the procedure. Nothing to do with ODS Excel that is basic title/footnote behavior.
Then you place a FOOTNOTE; before the second Proc Print clearing all defined Footnotes.
Your subject says "into one sheet". But attempt to name that one sheet two times with the Sheet_name= option. So what name should that one sheet have? Using two names really questions the "into one sheet" premise.
See if this fixes the FOOTNOTE issue:
ods excel file ="/path/Ex15b.xlsx" style=statistical options( embedded_titles='yes' embedded_footnotes='yes' ); ods excel options(sheet_interval="NONE" sheet_name="Males"); title "My First Title"; title2 "My Third Title"; footnote "My First Footnote"; footnote2 "My Third Footnote"; proc print data= sashelp.class; where sex = 'M'; run; footnote; title 'RRR'; proc print data= sashelp.class; where sex = 'F'; run; ods excel close;
Not to mention Footnote2= 'My Third Footnote'; raises a question of do you expect this to be the third or the second footnote???
How much space? Exactly where? Between the first proc print and the foonotes? After the first footnote before the second title? After the second title before the second print?
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.