Usage Note 24041: In ODS RTF, can I change the location of the page numbers and the date from the top right corner?
The location of the page number and date can be modified by adding RTF code to the TITLE
or FOOTNOTE statement. First issue
the system options NONUMBER and NODATE to remove the default page number and date.
Example 1, below, right-justifies the date and the page number in the RTF file.
Example 2 adds only the page number to the bottom of the page,
right-justified. View output.
/* Example 1 */
options nonumber nodate;
ods rtf body='temp.rtf' ;
proc print data=sashelp.class;
footnote j=r '{\field{\*\fldinst{\pard\b0\i0\chcbpat8\ql\fc\fs19
\cf1{DATE \\@ "hh:mm dddd, MMMM dd, yyyy " }\cf0\chcbpat0}}}
{\field{\*\fldinst{\pard\b\chcbpat8\qc\f1\fs19\cf1
{PAGE }\cf0\chcbpat0}}}';
run;
ods rtf close;
/* Example 2 */
ods rtf body='temp.rtf' ;
proc print data=sashelp.class;
footnote j=r '{\field{\*\fldinst{\pard\b\i0\chcbpat8\qc\f1\fs19\cf1
{PAGE }\cf0\chcbpat0}}}';
run;
/* The below adds the prefix of "Page" */
proc print data=sashelp.class;
footnote1 j=r "{\b\ Page}{\field{\*\fldinst {\b\i PAGE }}}\~
{\b\i of}\~{\field{\*\fldinst{\b\i NUMPAGES }}}";
run;
ods rtf close;
In SAS 9.1 and later, the page number and pageof information can be placed on FOOTNOTE or TITLE statements with the inline style commands {thispage} and {pageof}:
ods listing close;
options nonumber;
ods escapechar="^";
ods rtf file="temp.rtf";
proc print data=sashelp.retail;
footnote1 j=r "^{thispage}";
footnote2 j=r "^{pageof}";
run;
ods rtf close;
See more information about
PROC TEMPLATE and the RTF destination.
Operating System and Release Information
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Type: | Usage Note |
| Priority: | low |
| Topic: | SAS Reference ==> ODS (Output Delivery System) Third Party ==> Output ==> RTF
|
| Date Modified: | 2007-08-28 14:41:13 |
| Date Created: | 2004-06-28 12:45:31 |