Desktop productivity for business analysts and programmers

ODS excel file multiple sheet names and unique titles and footnotes

Reply
User
Posts: 1

ODS excel file multiple sheet names and unique titles and footnotes

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;

 

Esteemed Advisor
Posts: 6,699

Re: ODS excel file multiple sheet names and unique titles and footnotes

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Esteemed Advisor
Esteemed Advisor
Posts: 7,250

Re: ODS excel file multiple sheet names and unique titles and footnotes

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.

Grand Advisor
Posts: 17,428

Re: ODS excel file multiple sheet names and unique titles and footnotes

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

Ask a Question
Discussion stats
  • 3 replies
  • 235 views
  • 0 likes
  • 4 in conversation