02-06-2013 06:59 PM
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.
02-06-2013 09:21 PM
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;
ods rtf file='c:\temp\cars.rtf';
title 'Title 1';
proc means data=sashelp.cars maxdec=2;
where make in ('Buick', 'Cadillac', 'Chevrolet');
class model type;
var cylinders horsepower mpg_city;
ods rtf close;
02-07-2013 03:37 PM
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;
ods rtf close;
options date stimer label;
FIRST PAGE OF MY OUTPUT IN THE RTF FILE:
02-07-2013 04:53 PM
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.
02-07-2013 06:32 PM
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?
02-08-2013 10:59 AM
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....
02-07-2013 07:02 PM
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.
02-08-2013 11:01 AM
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...