BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

I try to shrink my output tables in order to have one complete table per page. I am not using a Proc report, the tables come from Tabulate Freq Corr or TTest.

I read the subject posted by MM "ODS PDF - Shrinking output to fit to one page
Posted: Aug 9, 2006 4:36 PM "
answered by Cynthia@sas.

Here is a part of her/your answer:
"There is no "shrink to fit" with ODS because ODS leaves it to the viewer/rendering software to control printing issues."
I would like to know if there is any chance to find a way to have tables fit under RTF?

Thank you very much,

Anais
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi, Anais:
First, the LANDSCAPE option will work for any procedure, not just REPORT or TABULATE. So that's one thing to try. Next, the techniques described for PROC REPORT will also work for PROC TABULATE -- the syntax is slightly different. For example, in PROC REPORT, you would have:

[pre]
proc report data=sashelp.shoes
style(report)={font_size=6pt cellpadding=3};[/pre]

while in proc tab, the report style overrides would be on the TABLE statement:
[pre]
table rowdim,
coldim
/style={font_size=6pt cellpadding=3};
[/pre]

The techniques described in the previous response will also work for PROC PRINT, as well as REPORT and TABULATE. Each procedure has a slightly different syntax, but works the same in concept. The SAS documentation has good examples of using style= overrides with these 3 procedures.

As for OTHER procedures (like FREQ or CORR or MEANS or UNIVARIATE, etc, etc), there IS a way to change the style characteristics of the output from these procedures. It involves changing the style template that you use when you invoke ODS RTF...for example:
[pre]
options orientation=landscape;
ods rtf file='wombat.rtf' style=journal;
[/pre]
produces a landscape report using the journal style in SAS 9 instead of the default RTF style. If you used PROC TEMPLATE to create a custom style template, then the style attributes that are changing in the PROC REPORT example would, instead, be specified in the style template, in this general fashion:
[pre]
proc template;
define style styles.smallRTF;
parent=styles.RTF;
....more code....
end;
run;
options orientation=landscape;
ods rtf file='koala.rtf' style=styles.smallRTF;
PROC FREQ, PROC CORR, etc
ods rtf close;
[/pre]

In fact, IF you were going to go down the custom style template road, you would not even need to override style attributes inside PROC REPORT, TAB or PRINT anymore, unless you wanted to override them for a particular column or perform traffic lighting.

However, the code that goes inside PROC TEMPLATE is verbose and is too long to post here. I recommend that you refer to these sites or contact Tech Support for help with a style template that will accomplish what you want.
cynthia

some helpful sites:
http://support.sas.com/faq/045/FAQ04503.html (shrinking font in RTF)
http://support.sas.com/faq/039/FAQ03993.html (changing header font)
http://support.sas.com/faq/039/FAQ03992.html (changing cell values)
deleted_user
Not applicable
Cynthia,

Again, thank you for your complete answer/advice.
It is very useful!

Anais
SASEnthusiast
Obsidian | Level 7

Hi Cynthia,

 

This was so helpful. Thank you so much.

I have a question-

My proc corr- var statement has lot of variables. This creates indvidual plots on the result. When I use the code-

 

options orientation=landscape;
ods rtf file='koala.rtf' style= journal;
PROC FREQ, PROC CORR, etc
ods rtf close;

 

It prints only tables in the output and no graphs. Could you help me with this?

Cynthia_sas
SAS Super FREQ

Hi: It is probably not a good idea to piggyback a new question onto an older track.

 

Do you have ODS GRAPHICS turned on? Are you at least running SAS 9.2? Have you put the appropriate PLOTS= options in the PROC FREQ and PROC CORR steps? When I run the code below, I do see graphics in the output RTF file.

 

cynthia
 
ods graphics on;

options orientation=landscape;
 ods rtf file='c:\temp\koala.rtf' style= journal;

 
proc freq data=sashelp.class;
title '1) FREQ';
  tables age / nocum nopercent  plots=(all);
run;
    
proc corr data=sashelp.fish plots=matrix(histogram);
title '2) CORR';
run;
  
ods rtf close;

 

 

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