Hello,
I am trying to output a large number of tables using PROC TABULATE to a MS Word document (SAS 9.4). Each table has its own footnote. I have used ODS RTF with bodytitle option but the footnotes are defaulting to print a couple of lines below the table, which is taking up way too much space and makes it hard to read.
I tried using parskip and the TAGSETS version of ODS RTF, but when I do that it only prints the last footnote - all the rest are just missing.
Any help would be much appreciated! Thanks
-Jenine
What style are you using for your ODS RTF output?
You can create and modify your own style that may be able to help with that, I'm not sure what the setting would be for that particular option.
This is my standard RTF style:
https://gist.github.com/statgeek/9603140
You can see the source code for a particular style using the following code:
proc template;
source style_name;
run;quit;
And as always the ever helpful, albiet too full of information link to the documentation. Example 7 talks about footers/headers but not sure it's the same as footnote.
Thank you for the style template Reeza. Using your template my tables look great but the default for footnotes is still to appear a few lines below the table. This leaves big gaps on each page and makes it really hard to read. I want to change it so the footnote appears directly below each table.
I can't find any options within the style to adjust this distance. The only thing I could find was parskip using TAGSETS, but then I lose all but the last footnote. For some reason TAGSETS doesn't seem to allow a different footnote beneath each table.
-Jenine
You should be able to specify unique footnotes per table.
Can you post some code that replicates your issue, preferably using SASHELP data sets so we can run it as well.
Also, what version of SAS do you have?
I've also moved the post to the Reporting forum so hopefully someone else with more experience can help answer your question.
Thank you, I've not posted on this forum before so I wasn't sure where to put it. I'm using SAS 9.4.
Here is some code using the sashelp.class dataset that produces the "too far away" footnote version, using your style template:
proc template; define style styles.newrtf; parent=styles.rtf; style header / background = white font=(Times, 11pt, Bold); replace fonts / 'TitleFont2' = ("Times",12pt,Bold Italic) 'TitleFont' = ("Times",12pt,Bold) 'StrongFont' = ("Times",11pt,Bold) 'EmphasisFont' = ("Times",11pt,Italic) 'FixedEmphasisFont' = ("Courier New, Courier",10pt,Italic) 'FixedStrongFont' = ("Courier New, Courier",10pt,Bold) 'FixedHeadingFont' = ("Courier New, Courier",10pt,Bold) 'BatchFixedFont' = ("SAS Monospace, Courier New, Courier",8pt) 'FixedFont' = ("Courier New, Courier",10pt) 'headingEmphasisFont' = ("Times",12pt,Bold Italic) 'headingFont' = ("Times",11pt,Bold) 'docFont' = ("Times",9pt); replace Table from Output / rules = all cellspacing = 0.5pt cellpadding = 2.0pt; end; run; data work.class; set sashelp.class; overall=1; run; ods listing close; ods rtf file="C:\Users\jdankovchik\Desktop\sample_rtf.rtf" style=styles.newrtf bodytitle keepn startpage=no; proc tabulate data=work.class missing; keylabel all="TOTAL"; class sex / S=[background=lightblue font_weight=bold just=left]; classlev sex overall/style=[cellwidth=4 in asis=on]; VAR OVERALL; tables sex all, overall=''*(n*f=4.0 colpctn='(%)'*f=pctfmt.)/misstext='0' rts=15 box=[label="Testing Table 1" style=[font_size=12pt]]; keyword all / style={font_style=italic}; footnote "Testing Footnote 1"; run; proc tabulate data=work.class missing; keylabel all="TOTAL"; class age / S=[background=lightblue font_weight=bold just=left]; classlev age overall/style=[cellwidth=4 in asis=on]; VAR OVERALL; tables age all, overall=''*(n*f=4.0 colpctn='(%)'*f=pctfmt.)/misstext='0' rts=15 box=[label="Testing Table 2" style=[font_size=12pt]]; keyword all / style={font_style=italic}; footnote "Testing Footnote 2"; run; ods rtf close; ods listing;
And here is the only way I figured out to adjust the distance between table and footnote, again using your style template but adding parskip and then using ODS TAGSETS.RTF. But as you see with this one, altough the footnote is now in a sensible place, only the last table gets its footnote. The rest are just missing.
proc template; define style styles.newrtf2; parent=styles.rtf; style header / background = white font=(Times, 11pt, Bold); style parskip / fontsize = 6pt; replace fonts / 'TitleFont2' = ("Times",12pt,Bold Italic) 'TitleFont' = ("Times",12pt,Bold) 'StrongFont' = ("Times",11pt,Bold) 'EmphasisFont' = ("Times",11pt,Italic) 'FixedEmphasisFont' = ("Courier New, Courier",10pt,Italic) 'FixedStrongFont' = ("Courier New, Courier",10pt,Bold) 'FixedHeadingFont' = ("Courier New, Courier",10pt,Bold) 'BatchFixedFont' = ("SAS Monospace, Courier New, Courier",8pt) 'FixedFont' = ("Courier New, Courier",10pt) 'headingEmphasisFont' = ("Times",12pt,Bold Italic) 'headingFont' = ("Times",11pt,Bold) 'docFont' = ("Times",9pt); replace Table from Output / rules = all cellspacing = 0.5pt cellpadding = 2.0pt; end; run; data work.class; set sashelp.class; overall=1; run; ods listing close; ods tagsets.rtf file="C:\Users\jdankovchik\Desktop\sample_rtf.rtf" style=styles.newrtf2 startpage=no; proc tabulate data=work.class missing; keylabel all="TOTAL"; class sex / S=[background=lightblue font_weight=bold just=left]; classlev sex overall/style=[cellwidth=4 in asis=on]; VAR OVERALL; tables sex all, overall=''*(n*f=4.0 colpctn='(%)'*f=pctfmt.)/misstext='0' rts=15 box=[label="Testing Table 1" style=[font_size=12pt]]; keyword all / style={font_style=italic}; footnote "Testing Footnote 1"; run; proc tabulate data=work.class missing; keylabel all="TOTAL"; class age / S=[background=lightblue font_weight=bold just=left]; classlev age overall/style=[cellwidth=4 in asis=on]; VAR OVERALL; tables age all, overall=''*(n*f=4.0 colpctn='(%)'*f=pctfmt.)/misstext='0' rts=15 box=[label="Testing Table 2" style=[font_size=12pt]]; keyword all / style={font_style=italic}; footnote "Testing Footnote 2"; run; ods rtf close; ods listing;
I appreciate any insight you may have! Thanks very much
-Jenine
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.