The SAS Output Delivery System and reporting techniques

Page X of Y

Reply
N/A
Posts: 0

Page X of Y

HI
can anyone tell me the best way to get page x of y while using Proc report with Pdf Output.
thanks
N/A
Posts: 0

Re: Page X of Y

There are multiple SAS Conference papers on this that you'll find by looking on the SAS Support web site.
SAS Employee
Posts: 47

Re: Page X of Y

To be more specific:
go to www.lexjansen.com and search: "page x of y" pdf
This will give you a lot of SAS proceedings that answer your question.

Lex Jansen
Contributor
Posts: 50

Re: Page X of Y

I think is this that you want:

footnote1 j=right height=1 "Page ^{thispage} of ^{lastpage}";
SAS Super FREQ
Posts: 8,743

Re: Page X of Y

Hi:
In order for the footnote statement to work, you must declare what the ODS ESCAPECHAR value is. ODS ESCAPECHAR is the special character that lets ODS know that you want to do something special (like use the {thispage} and/or {lastpage} Escapechar functions. Something along the lines of:
[pre]
ods pdf file='wombat.pdf';
ods escapechar='^';

footnote1 j=right height=1 "Page ^{thispage} of ^{lastpage}";
.... more code ....
ods pdf close;
[/pre]

Generally, I recommend the use of ~ (tilde) or ^ (caret) or # (sharp/pound sign) for the Escape character, because you are unlikely to have them in a title or footnote text. Or conversely, avoid any punctuation that you might find in an operating system path or title text or urls or email addresses, such as : \ / ; ! @ $ % & * < > (not a comprehensive list of all punctuation that I avoid). Mostly I use ~ or ^ or #.

cynthia
Ask a Question
Discussion stats
  • 4 replies
  • 126 views
  • 0 likes
  • 4 in conversation