The SAS Output Delivery System and reporting techniques

Proc Means output within ods RTF output

Reply
Occasional Contributor Mur
Occasional Contributor
Posts: 10

Proc Means output within ods RTF output

Hi all,

The tables generated by proc means within ods rtf output is not being split between pages.  I have only header on one page and on the second page I have header and the rest of the table.  There is a lot of white space in between.  Why are the tables not being split?  I think my titles are pushing the tables to the next page.  How do I get around this? Appreciate any help.

Thanks,

Mur

SAS Super FREQ
Posts: 8,818

Re: Proc Means output within ods RTF output

Hi:

  Without seeing ALL your code, including ODS statements and your PROC MEANS code, it's hard to say why something is happening. I don't know what you mean when you ask "why are tables not being split". Can you replicate the problem using one of the SASHELP datasets? Can you explain what you mean in a bit more detail?

  If I run this code, with PROC MEANS, it produces multiple tables using SASHELP.CARS and I do not see a problem.

  Also, remember that if you are using BY group processing, that should make every BY group start at the beginning of a new page and the normal BY line only appears at the beginning of the group. The BY group behavior could also leave some white space at the end of the previous BY group. Using the #BYLINE option in the title will get the BY line on every page. In my results, there is extra white space at the end of the page for Buick and Cadillac because there are not as many groups for those two makes as there are for Chevrolet.

  It's hard to guess what else you might mean.

cynthia

ods listing close;

options nobyline;

ods noptitle;

   

ods rtf file='c:\temp\cars.rtf';

title 'Title 1';

title2 'Title2';

title3 '#byline';

   

proc means data=sashelp.cars maxdec=2;

where make in ('Buick', 'Cadillac', 'Chevrolet');

by make;

class model type;

var cylinders horsepower mpg_city;

run;

ods rtf close;

options byline;

title;

Occasional Contributor Mur
Occasional Contributor
Posts: 10

Re: Proc Means output within ods RTF output

Hi Cynthia,

Thank you so much for your reply.  I am sorry for not being very clear.  Options 'nobyline' and 'noptitle' were new to me.  I tried them but did not help. I tried to replicate this using one of sashelp datasets, but could not find one with as many variables/columns.   I have pasted my code below.  I have a total of 54 variables that I am asking for basic measures from proc means (so a long output table).  Also note that I am using the 'bodytitle' option.  When I run my code, in my output, on the first page, I only have my three titles, one line for 'The Means Procedure', one line for 'Treat=1', and the header from the proc means output table; rest of the page is empty (pasted below after code). On the second page, I have the full table along with the table header but no titles or other lines (which is why it can accommodate the table) .  I am wondering if there is way to split this table so that most of my first page is not empty and part of the table is on page 1 and part goes to page 2.  I have a total of six tables generated for the six by groups.  On every other page, whenever my three titles, and the other lines are printed, the rest of the page is empty.  For now, my way around this is, I manually go into MS Word (after the ods rtf output is generated) and decrease the font size of the tables, so that they fit in a page with the titles and the other two lines.

Thank you, again!!


SAS CODE:

title;

options nodate nostimer nolabel;

ods rtf file="&file" bodytitle;

Title bold italic color=darkgreen height=4 "&title";

Title2 bold italic color=BIV height=3 "&title2";

Title3 color=red "Raw Means";

proc sort data=&dir..single out=single_s; by Treat;

proc means data=single_s nway maxdec=2 mean stddev min max cv;

by Treat;

var

a

b

c

d

e

aa

bb

cc

;

run;

ods rtf close;

options date stimer label;

FIRST PAGE OF MY OUTPUT IN THE RTF FILE:

Capture.PNG

Super User
Posts: 11,107

Re: Proc Means output within ods RTF output

Unless you need the "The Means Procedure" I would sat to add ODS NOPROCTITLE; to suppress that line and get some space back. Also when your tables are splitting in an unexpected place you might not want to use BodyTitle. Since RTF will grab some space for a header even when you aren't placing the titles in the header you lose some display space. Third would be selection or modification of the style. If you have Meadow, Festival or Grayscaleprinter available try those as they will use 8 point Arial instead of the 10 point Times New Roman of the default RTF style.

Super User
Posts: 19,047

Re: Proc Means output within ods RTF output

How big is that variable a? My only experience with that happening is when teh variable is too long to fit on the page. If its character is it set too big?

Occasional Contributor Mur
Occasional Contributor
Posts: 10

Re: Proc Means output within ods RTF output

The longest variable I have is 10...

Frequent Contributor
Frequent Contributor
Posts: 94

Re: Proc Means output within ods RTF output

Perhaps not an ideal solution but you could try OPTIONS ORIENTATION=LANDSCAPE to check if it works.

Occasional Contributor Mur
Occasional Contributor
Posts: 10

Re: Proc Means output within ods RTF output

Thanks, Ballardw!  No bodytitle with festival/meadow style did the trick.  I guess I won't be able to use bodytitle option anymore..

Thank you all for the suggestions.  I appreciate your time....

Mur

Contributor
Posts: 25

Re: Proc Means output within ods RTF output

Hi Mur,

Like Cynthia and ballardw, I would recommend you use ODS NOPROCTITLE.  I also would use ODS NOKEEPN and not use the ODS BODYTITLE option.  If you have some reason for wanting to use BODYTITLE, then open your output in your word processor (MS-Word?) and set 'Header from Top' and 'Footer from Bottom' to zero. 

Occasional Contributor Mur
Occasional Contributor
Posts: 10

Re: Proc Means output within ods RTF output

Thank you, DaveBirch!  Setting the top and the bottom margins to zero did not help.  I had to go with no bodytitle and select a style with smaller font size...

Mur

Ask a Question
Discussion stats
  • 9 replies
  • 932 views
  • 6 likes
  • 6 in conversation