ODS measures tables, titles, and notes horizontally on a page. This allows ODS to break and wrap tables that are too wide for a page. However, ODS does not measure the page vertically. Instead, measuring vertically is performed by Microsoft Word, because it positions items like titles and footers unpredictably. When a table splits across multiple pages, Microsoft Word is responsible for repeating the column headers. The PROC TABULATE code below illustrates this behavior.
ods rtf file='c:\temp\odsrtf.rtf' ;
title "This is a title" ;
data class;
set sashelp.class;
do i=0 to 1 by .1;
age=age+i;
output;
end;
run;
proc tabulate data=class missing ;
class sex age ;
var height weight;
table sex*(age*all) all ,
weight height*f=comma8. ;
keylabel all='Total' sum=' ';
run;
ods rtf close;
See more information about PROC TEMPLATE and the RTF destination.
In SAS® 9.2, the TAGSETS.RTF destination allows more control over paging. Using TAGSETS.RTF with the UNIFORM option will repeat column headers across pages in PROC TABULATE output. To use TAGSETS.RTF, change the ODS RTF statement above to the following:
ods tagsets.rtf file='c:\temp\odsrtf.rtf' uniform;
Change the closing ODS statement to the following:
ods tagsets.rtf close;
See more information about the TAGSETS.RTF destination.