BookmarkSubscribeRSS Feed
Calcite | Level 5 Mur
Calcite | Level 5

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.





  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.


ods listing close;

options nobyline;

ods noptitle;


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

title 'Title 1';

title2 'Title2';

title3 '#byline';


proc means maxdec=2;

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

by make;

class model type;

var cylinders horsepower mpg_city;


ods rtf close;

options byline;


Calcite | Level 5 Mur
Calcite | Level 5

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!!



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;












ods rtf close;

options date stimer label;



Super User

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

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?

Calcite | Level 5 Mur
Calcite | Level 5

The longest variable I have is 10...

Calcite | Level 5 VD
Calcite | Level 5

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

Calcite | Level 5 Mur
Calcite | Level 5

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....


Obsidian | Level 7

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. 

Calcite | Level 5 Mur
Calcite | Level 5

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...


Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 9 replies
  • 6 in conversation