Customizing page numbers in the ODS PDF destination


Beginning with SAS® 9.1, page numbers can be customized in PDF output by using an escape character and the {thispage} function, {lastpage} function, or both. See the following example code:

ods escapechar='^';
ods listing close;
ods pdf file='test.pdf';

data test;
  do i=1 to 50;
    output; 
  end;
run;

proc print data=test noobs;
title 'Page ^{thispage} of ^{lastpage}';
run;

ods listing;
ods pdf close;

Page numbering is not available with SAS/GRAPH output routed to the PDF destination until SAS® 9.2.