BookmarkSubscribeRSS Feed
datj
Calcite | Level 5

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;

 

3 REPLIES 3
Kurt_Bremser
Super User

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.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Reeza
Super User

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

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
  • 3 replies
  • 1846 views
  • 0 likes
  • 4 in conversation