09-14-2016 03:04 AM
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 :-)
%if %sysfunc(exist(table_1.)) %then
ods excel file="\\where_the_excel_output_goes" options(absolute_column_width='30' sheet_interval='PROC' sheet_name='sheetname')
proc report data=table_1 nowd;
%if %sysfunc(exist(table_2)) %then
proc report data=table_2 nowd;
ods excel close;
09-14-2016 03:22 AM
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.
09-14-2016 04:40 AM
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.
09-14-2016 04:44 AM
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?
Best resource so far: