I output a plot to RTF (MS Word) and the header and footer are 2.54 cm in height.
The plot is crowded, so I want to decrease the header and footer (to say 1.27 cm) so that the body can grow for the plot.
I have tried to look for a solution online and I have been thinking that it would be something to do with proc template define style.
The attachments show what I mean in MS Word and my setup in proc template define style class for the adjustment of the top, right, bottom & left margins (which doesn't work as I thought it would).
Should I be working with the 'systemheader' and 'systemfooter' rather? Or something else? Can the MS Word header and footer actually be modified in this manner?
I am familiar with RTF codes \qc etc.;, so would that be an option?
I have also tried adding the 'bodytitle' to the ODS RTF statement to make the title appear in the document body (thinking it might majically make the header and footer disappear 😄 ) but it obviously has no effect on the size of the header/footer.
Any advice would be very much appreciated!
Hi:
Here's a response from 2011: https://communities.sas.com/t5/ODS-and-Base-Reporting/What-does-HEADERY-do/td-p/13613 and here is the original TS note: https://support.sas.com/kb/24/168.html . My understanding from the "old" days talking to the ODS developers when ODS RTF first came out was that some ODS measurements in RTF end up being converted into TWIPS when the RTF file is created because ODS generates RTF control strings and the RTF control strings expect the measurements to be specified in TWIPS.
HEADERY and FOOTERY were NOT in the original ODS RTF set of options, (I think they were introduced in SAS 9.1 approx) and since they are so specific to ODS RTF and how the document is rendered in Word, at some point the decision must have been made to specify them in TWIPS. The "why" is a mystery to me.
What I observe is that if I do a simple ODS RTF with 1 inch margins and no specification for HEADERY and FOOTERY, all of the measurements in the generated RTF file seem to be in TWIPS, and it looks like HEADERY and FOOTERY are set to be 1440, as shown below:
When I specify values for HEADERY and FOOTERY, my values go directly into the RTF file, as shown below:
Hope this helps,
Cynthia
How does one edit an own post? Never mind ... found it! 😄
options nonumber nodate topmargin=0cm bottommargin=0cm;
ods rtf file='c:\temp\temp.rtf' headery=1 footery=1 ;
title 'XXXXXXXXX';
ods graphics/outputfmt=png noborder;
proc sgplot data=sashelp.heart(obs=100) ;
scatter x=weight y=height/group=sex;
run;
ods rtf close;
Thank you KSharp! I have seen many of your responses on the forum. It's a please to have address my query! 🙂
I can't quite understand the difference between using the 'options topmargin=1.27cm bottommargin=1.27cm' and using 'ods rtf ... headery=720 footery=720'. Is it just that the ods options allows you use inches or cms and RTS headery/footery you must use twips?
Thanks again for the answer! I really appreciate it! 😄
Hi:
Here's a response from 2011: https://communities.sas.com/t5/ODS-and-Base-Reporting/What-does-HEADERY-do/td-p/13613 and here is the original TS note: https://support.sas.com/kb/24/168.html . My understanding from the "old" days talking to the ODS developers when ODS RTF first came out was that some ODS measurements in RTF end up being converted into TWIPS when the RTF file is created because ODS generates RTF control strings and the RTF control strings expect the measurements to be specified in TWIPS.
HEADERY and FOOTERY were NOT in the original ODS RTF set of options, (I think they were introduced in SAS 9.1 approx) and since they are so specific to ODS RTF and how the document is rendered in Word, at some point the decision must have been made to specify them in TWIPS. The "why" is a mystery to me.
What I observe is that if I do a simple ODS RTF with 1 inch margins and no specification for HEADERY and FOOTERY, all of the measurements in the generated RTF file seem to be in TWIPS, and it looks like HEADERY and FOOTERY are set to be 1440, as shown below:
When I specify values for HEADERY and FOOTERY, my values go directly into the RTF file, as shown below:
Hope this helps,
Cynthia
Wow! Another legend! 😄 Thank you @Cynthia_sas for the response, it's very much appreciated. And thanks @Ksharp for the referral! 😄
TIL:
Unfortunately, the link on the TS note page is dead i.e., https://support.sas.com/rnd/base/ods/odsrtf/rtf901.html. How does one get that fixed?
Thanks again for your responses.
Michael
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: