The SAS Output Delivery System and reporting techniques

ODS PDF No page number for first page

Reply
Frequent Contributor
Posts: 99

ODS PDF No page number for first page

Hi,
I want no page number for first page. From second page onwards I want "page 1 of last page" . Total number of pages does not include first page.

Thanks in advance for help,

Amit
SAS Super FREQ
Posts: 8,869

Re: ODS PDF No page number for first page

Hi, assuming you want something like the 2 PROC PRINTs below, you can manipulate the page numbering at a step boundary as shown in the program.

However, if you wanted to run PROC GLM, (for example) and have page 1 without page numbers and then have the rest of the output with page numbers, this is not possible without post processing the output.

In order to get Page X of Y page numbering, you must use ODS ESCAPECHAR functions ^{thispage} and ^{lastpage}. In my program, I show an ESCAPECHAR of ^. If you used a different ESCAPECHAR, (such as ~), then your function calls would change to ~{thispage} and ~{lastpage}.

cynthia
[pre]
options nodate nonumber;
title; footnote;

ods pdf file='change_nums_middle3.pdf';
ods escapechar='^';

proc print data=sashelp.shoes(firstobs=1 obs=33);
title 'My Report from PROC PRINT with no Page Numbers';
run;
title;
footnote;

options pageno = 1;
ods pdf;

proc print data=sashelp.shoes(firstobs=34 obs=120);
title 'Page Numbers Start here (in footnote)';
footnote j=r 'Page ^{thispage} of ^{lastpage}';
run;

ods pdf close;
title;
footnote;
[/pre]
Frequent Contributor
Posts: 99

Re: ODS PDF No page number for first page

Hi Cynthia,
Thanks for your reply. This is what I was looking for.

Thanks,
Amit
Ask a Question
Discussion stats
  • 2 replies
  • 2137 views
  • 0 likes
  • 2 in conversation