BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
LUISBARTHOLO
Calcite | Level 5

Hi all!

I just wanted to add pageborders in the output.

Something like this:

LUISBARTHOLO_0-1671566446734.png

 

Here is the code:


ods RTF startpage=no file="c:\sas\sas.docx" NOGTITLE NOGFOOTNOTE style=word;
options nonumber nodate;

title PAGE BORDER;
footnote;

ODS RTF startpage=now TEXT="{\pard\b\qc {PAGE1} \par}"; RUN;

proc odstext;
p "REPORT:" /style=[fontweight=bold textalign=c fontsize=20pt fontfamily=Arial];
run;

proc report data=sashelp.cars contents="Honda Cars";
where Make="Honda";
column ("Car" make model) ("Cost" msrp invoice)
("Fuel Efficiency" mpg_city mpg_highway);
run;

ODS RTF startpage=now TEXT="{\pard\b\qc {PAGE2} \par}"; RUN;

proc report data=sashelp.cars nowd OUT=QUARTILES;
column origin type msrp msrp=msrp2 msrp=msrp3 msrp=msrp4 msrp=msrp5;
define origin / group;
define type / group;
define msrp / p25;
define msrp2 / median;
define msrp3 / p75;
define msrp4 / min;
define msrp5 / max;
run;

ods RTF close;

 

 

1 ACCEPTED SOLUTION
6 REPLIES 6
fja
Lapis Lazuli | Level 10 fja
Lapis Lazuli | Level 10

Hello there and Merry Christmas!

Is it the frames around the page area you are after or is it some sort of margin. 

And what output type are you after? ... as your pictures of the output already contain frames.  Running your code on my system does include page frames in the resulting rtf, though.

Cheers

FJa

LUISBARTHOLO
Calcite | Level 5

This is what i get with the code (no boarders):

LUISBARTHOLO_2-1676662185351.png

This is what I would like (with boarders):

LUISBARTHOLO_3-1676662214531.png

Kathryn_SAS
SAS Employee

The following style template adds a visible top and bottom page margin, but I have not found a way to add a left or right margin. This also adds a blank Footnote.

proc template;
 define style styles.test;
 parent=styles.rtf;
 class systemtitle /
  bordertopcolor=black
  bordertopwidth=2pt;
 class systemfooter /
  borderbottomcolor=black
  borderbottomwidth=2pt;
 class body /
  frame=box;
 end;
run;

ods _all_ close;
ods RTF startpage=no file="c:\temp\test.rtf" NOGTITLE NOGFOOTNOTE 
 style=styles.test;
options nonumber nodate;

title PAGE BORDER;
footnote ' ';

ODS RTF startpage=now TEXT="{\pard\b\qc {PAGE1} \par}"; RUN;

proc odstext;
p "REPORT:" /style=[fontweight=bold textalign=c fontsize=20pt fontfamily=Arial];
run;

proc report data=sashelp.cars contents="Honda Cars";
where Make="Honda";
column ("Car" make model) ("Cost" msrp invoice)
("Fuel Efficiency" mpg_city mpg_highway);
run;

ODS RTF startpage=now TEXT="{\pard\b\qc {PAGE2} \par}"; RUN;

proc report data=sashelp.cars nowd OUT=QUARTILES;
column origin type msrp msrp=msrp2 msrp=msrp3 msrp=msrp4 msrp=msrp5;
define origin / group;
define type / group;
define msrp / p25;
define msrp2 / median;
define msrp3 / p75;
define msrp4 / min;
define msrp5 / max;
run;

ods RTF close;
LUISBARTHOLO
Calcite | Level 5

Thank you very much!!

LUISBARTHOLO
Calcite | Level 5

Thank you !!

SAS Innovate 2025: Call for Content

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 6 replies
  • 1329 views
  • 1 like
  • 3 in conversation