Hi.
I am unable to export a title and a footnote along with a table to excel using proc report. However, it does print the titles and footnotes along with the tables in the result section. What do I do wrong? Moreover, is it somehow possible to use different sheet names? (I am using SAS Enterprise Guide 7.1.) I really hope someone can help me 🙂
Kind Regards
%if %sysfunc(exist(table_1.)) %then
%do;
ods excel file="\\where_the_excel_output_goes" options(absolute_column_width='30' sheet_interval='PROC' sheet_name='sheetname')
style=pearl;
title1 "Title1";
footnote "Footnote1";
proc report data=table_1 nowd;
run;
%end;
%if %sysfunc(exist(table_2)) %then
%do;
title1 "Title2";
footnote "Footnote2";
proc report data=table_2 nowd;
run;
%end;
ods excel close;
For your second question, try setting sheet_interval='none' in the initial ods statement, and then use separate ods excel options(sheetname="....") statements before the respective reports.
This is a "feature" of Excel. Titles and Footnotes are not shown in the default view of Excel. If you set the screen to print preview view - lower right of the Excel screen - small icons, you will then see titles/footnotes.
Do note also that your logic is incorrect. The file is only created if the first file exists, you want to move the ods statement before the first %if check block.
Check if your title and footnote are in your header/footnote section of Excel.
Also check the embedded_title/footnote option which will move them to your main sheet.
What version of Excel are you using? You can check this with he following which puts the version to your log. Note that ODS Excel is pre-production until this latest release (9.4TS1M3) or M2?
%put &syslver;
Best resource so far:
http://support.sas.com/resources/papers/proceedings16/SAS5642-2016.pdf
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.