BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

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;
2 REPLIES 2
SASJedi
SAS Super FREQ

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.

Check out my Jedi SAS Tricks for SAS Users
ballardw
Super User

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?

sas-innovate-2024.png

 

Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.

 

Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 

 

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
  • 168 views
  • 0 likes
  • 3 in conversation