SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
JM_Poilane
SAS Employee

Hi,

In SAS 9.4 TS1M2 I try to set margins on a RTF document generated by an "ODS RTF" statement. Through the "OPTIONS" statement I can set these margins (MARGINLEFT etc...) but they apply to all pages of RTF file. What I want is to specify theses margins from page to page.

I read in this paper that you have to use STYLES :

http://www2.sas.com/proceedings/sugi29/125-29.pdf

However any method described in this document that I try (set margins with precise values or set margins to _undef_ special value) does not work. The only way I can do it is through styles but then I lose the papersize on the second page of my report.

Do I use the goog approach?

How to get wanted margins ?

Thanks and best regards.

Jean-Marie

3 REPLIES 3
Ksharp
Super User

Try this one :

option topmargin=1cm orientation=portrait;
ods rtf file='c:\temp\xxx.rtf';
proc print data=sashelp.class ;run;
option topmargin=10cm orientation=landscape;
ods rtf ;
proc print data=sashelp.class ;run;
ods rtf close;


Xia Keshan

sm4
Quartz | Level 8 sm4
Quartz | Level 8

Late but maybe helpful to others (since I am having the same issue):

 

Here it says:

 

"The first thing we will learn how to modify is the margins. For other ODS destinations, it is possible to modify the margins using the system options TOPMARGIN, BOTTOMMARGIN, LEFTMARGIN, and RIGHTMARGIN. However, for the RTF destination, the margin settings are hard-coded into the default RTF template, and cannot be modified via an OPTIONS statement."

I'm reading the rest of it and it seems they suggest setting margins to undefined in the template and setting them separately after that.

sm4
Quartz | Level 8 sm4
Quartz | Level 8

That worked, except that I had to make sure my first options orientation statement was before my ods rtf file= statement.

But it added pages in between each output page, I guess something to do with this: http://support.sas.com/kb/17/498.html

Except that when I commented out all orientation statements, the problem persists....

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 3454 views
  • 0 likes
  • 3 in conversation