SUPPORT / SAMPLES & SAS NOTES
 

Support

Usage Note 24042: In ODS RTF, can I get my page numbers in page X of Y format?

DetailsAboutRate It

In SAS 9 and later, the experimental in-line formatting function {PAGEOF}, produces page X of Y numbering with Word 2000 and higher. Prior to SAS 9, you can add raw RTF code in the TITLE or FOOTNOTE statement. Below is an example of both. View output of the SAS 8.2 example.

   /* SAS 8.2 */
   /* CAUTION: Make sure the raw RTF code is on ONE line */
   ods listing close;
   options nonumber;
   ods rtf file="temp.rtf";
   proc print data=sashelp.retail;
    footnote j=r
     "{\field{\*\fldinst{\b\i PAGE}}}\~{\b\i of}\~{\field{\*\fldinst{\b\i NUMPAGES}}}";
   run;
   ods rtf close;

   /* SAS 9.0 and later */
   ods listing close;
   options nonumber;
   ods escapechar="^";
   ods rtf file="temp.rtf";
   proc print data=sashelp.retail;
    footnote j=r "^{pageof}";
   run;
   ods rtf close;

 

See more information about PROC TEMPLATE and the RTF destination.



Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemBase SASAlln/a
* 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.