This handy hint is seen in the following code: it demonstrates how to get page numbering in Page X of Y format when you have both graphs and tables in the same PDF output. The program uses BASE datastep and ODS code to generate the page numbering and display the output correctly.
/* sample code */
options nodate nonumber;
goptions device=actximg;
ods listing close;
ods noresults;
ods escapechar='*';
/* create the file with YY */
footnote j=r 'Page *{thispage} of YY';
ods pdf file="c:\temp\pagenumb.pdf" compress=0;
%macro pdf_code;
symbol v=plus;
proc gplot data=sashelp.class;
plot weight*height;
run ;quit;
proc print data=sashelp.air;
run;
%mend pdf_code;
%pdf_code;
ods pdf close;
/* get the number of pages */
data _null_;
infile "c:\temp\pagenumb.pdf" truncover;
length line $32000;
input line $char.;
if index(line,'YY') then do;
page=index(line,'Page');
of =index(line,'of');
num=substr(line,page+4,of-page-4);
call symput('num',trim(left(num)));
end;
run;
/* create the file with the number of pages */
ods results;
ods pdf file="c:\temp\pagenumb.pdf" compress=0;
footnote j=r "Page *{thispage} of &num";
%pdf_code;
ods pdf close;
For information on exporting SAS/Graph output in PDF format have a look at:
http://support.sas.com/techsup/technote/ts659/ts659.html