BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
honk
Obsidian | Level 7

Hi All,

 

I would like footnotes to appear after each procedure that is run and output to excel. Currently, I run my ods tagsets.excelxp and even if I have footnotes for each procedure, it only appears after the last procedure in the excel file.

 

This is an example of my code:

 

%macro rt (var= );

title "&var";
proc tabulate data=dsn;
var count rate;
class year &var ;
table &var , year*(Count Rate);
footnote "This is a footnote";
run;
footnote;
title;

%mend rt;

ods tagsets.excelxp path="c:\filepath" 
file="excelfilename.xls"
style = statistical 
options (embedded_titles = 'yes' 
		embedded_footnotes = 'yes' 
		sheet_name="sheetname"
		sheet_interval = 'none'
		merge_titles_footnotes="yes");

%rt(var= Sex)
%rt(var= Race)
%rt(var= Age)

ods tagsets.excelxp close;

The attached excel file is how it turns out. I'd like the footnote after each table.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Verify that you're using the latest tagsets. Using the latest version I don't see the issue you're having. You can find a NOTE in your log indicating the version, it should match the information below.

 

NOTE: This is the Excel XP tagset (Compatible with SAS 9.1.3 and above, v1.131, 04/23/2015).
Add options(doc='help') to the ods statement for more information.

You can download the latest version here:

http://support.sas.com/rnd/base/ods/odsmarkup/index.html

 

View solution in original post

5 REPLIES 5
Reeza
Super User

Verify that you're using the latest tagsets. Using the latest version I don't see the issue you're having. You can find a NOTE in your log indicating the version, it should match the information below.

 

NOTE: This is the Excel XP tagset (Compatible with SAS 9.1.3 and above, v1.131, 04/23/2015).
Add options(doc='help') to the ods statement for more information.

You can download the latest version here:

http://support.sas.com/rnd/base/ods/odsmarkup/index.html

 

honk
Obsidian | Level 7

Simple solution. Mine was:

NOTE: This is the Excel XP tagset (Compatible with SAS 9.1.3 and above, v1.127, 09/26/2011).

 

I updated to the most recent version you specified and it functions properly now.

 

Thank you very much. 

Ksharp
Super User

Try delete :

 

footnote;
title;

Or switch to use :

ods text="This is a footnote";
RW9
Diamond | Level 26 RW9
Diamond | Level 26

The reason you are not seeing footnotes is because that is the default action of Excel.  Excel is not a proper review format even though it appears everyone thinks it is.  If you goto the lower right of your Excel fil you will see three icons and a scroll bar.  If you select the middle icon - which will say print layout when hovered over - then it will show you the Excel file as a proper print format. The question is, if you want a review document with document features, then why not use a document format - PDF, RTF etc. which are built for that purpose?

 

One other note, you appear to have re-saved that document as a .xls file.  As the program you have given is actually generating XML output (which Excel can interpret) its a good idea not to name the output file xls, but rather xml.  You can still associate the extension xml with excel and get the same functionality, but someone taking the file will then know the contents of the file - which is what extensions are for (i.e. right click open with).

Reeza
Super User
Because embedded_footnotes option is specified they should show up by default, and they did in a test run on my PC.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 5 replies
  • 2395 views
  • 2 likes
  • 4 in conversation