By design, the BODYTITLE option on the ODS RTF statement only uses one instance of the titles and footnotes per table, and does not keep track of how many pages a table spans. If a table spans multiple pages, this means the title(s) will display on the first page, and the footnote(s) will display on the last page.
If text that repeats on every page is needed as part of the body of a document, you can use PROC REPORT logic which creates a "pagination" variable, and uses the PRETEXT and POSTTEXT style attributes to place text with every page. This pagination logic is also helpful if you keep the BODYTITLE option in effect and use TITLE or FOOTNOTE statements.
SAS Note 15727 shows how to get PAGEOF information using PROC TEMPLATE if the BODYTITLE option is in effect.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
/* Create a dummy data set called NEW. */
data new;
do i=1 to 100;
if i < 72 then type='first';
else type='last';
newval='newval'||left(i);
output;
end;
run;
/* SORT the data set BY the GROUP/ORDER variable(s) in */
/* the PROC REPORT step. */
proc sort data=new;
by type;
run;
/* PAGEIT increments once based on every 25 observations in FLAG */
/* grouping. FLAG is not needed in PROC REPORT, but is necessary */
/* in resetting PAGEIT. FLAG value of 25 is picked in this instance */
/* in order to paginate after every 25 detail rows - this number */
/* can VARY based on FONT_SIZE, MARGIN settings, ORIENTATION, etc. */
data reset;
set new;
by type;
if _n_ eq 1 then flag=0;
else flag+1;
if flag>=25 then do;
pageit+1;
flag=0;
end;
run;
ods listing close;
ods rtf file="file.rtf" BODYTITLE;
title "my title";
footnote "my footnote";
/* PAGEIT is set to NOPRINT as it will only be used for pagination. */
proc report data=reset nowd
style(report)={pretext="This pretends to be a title"
posttext="This pretends to be a footnote"};
column pageit type i newval;
define pageit / order order=internal noprint;
define type / order order=internal ;
define i / display;
break after pageit / page;
run;
ods rtf close;
ods listing;
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Type: | Sample |
Date Modified: | 2009-06-25 10:06:31 |
Date Created: | 2009-06-19 09:42:33 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | Base SAS | Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 SP4 | |
Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 SP4 | |||
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 SP4 | |||
z/OS | 9.1 TS1M3 SP4 | |||
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 SP4 | |||
Microsoft Windows 2000 Server | 9.1 TS1M3 SP4 | |||
Microsoft Windows 2000 Professional | 9.1 TS1M3 SP4 | |||
Microsoft Windows NT Workstation | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows XP Professional | 9.1 TS1M3 SP4 | |||
Windows Vista | 9.1 TS1M3 SP4 | |||
64-bit Enabled AIX | 9.1 TS1M3 SP4 | |||
64-bit Enabled HP-UX | 9.1 TS1M3 SP4 | |||
64-bit Enabled Solaris | 9.1 TS1M3 SP4 | |||
HP-UX IPF | 9.1 TS1M3 SP4 | |||
Linux | 9.1 TS1M3 SP4 | |||
Linux on Itanium | 9.1 TS1M3 SP4 | |||
OpenVMS Alpha | 9.1 TS1M3 SP4 | |||
Solaris for x64 | 9.1 TS1M3 SP4 | |||
Tru64 UNIX | 9.1 TS1M3 SP4 |