The SAS Output Delivery System and reporting techniques

Incorrect Pagination-SAS 9.3 - ods escapechar and Proc Report (break after statement)

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

Incorrect Pagination-SAS 9.3 - ods escapechar and Proc Report (break after statement)

In SAS 9.3, while using ods escapechar for pagination (method: 'Page ^{pageof}' in title statement) and break after statement in proc report, I am getting proper page break, but pagination goes incorrect on first page. e.g. If there are total 8 pages in rtf report, then first page shows 'Page 1 of 1', then from second page it shows proper pagination like 'Page 2 of 8', 'Page 3 of 8' and so on. 

 

When I ran below code in SAS 9.3, the first page of rtf report shows 'Page 1 of 1' (which should be 'Page 1 of 2') and second page shows 'Page 2 of 2' which is proper.

 

 
data test;
a=1; output;
a=2; output;
run;

ods escapechar = '^';

ods rtf file = '----PATH----\test.rtf';
title j=r 'Page ^{pageof}';
proc report data = test nowindows;
column a;
define a / order;
break after a / page; 
run;
ods rtf close;
 
I can always use different method for pagination, but if someone has come across this issue; or has tips or work arounds then that will be great.
 
Many thanks for the suggestions!

Accepted Solutions
Solution
‎03-10-2016 09:32 PM
SAS Super FREQ
Posts: 8,819

Re: Incorrect Pagination-SAS 9.3 - ods escapechar and Proc Report (break after statement)

Hi:
I thought there was a Tech Support note about this. Generally, all you have to do is scroll to the bottom of the file using Page Down to force Word to re-paginate the document. I think there's an 'F' key to do it, but I'm not sure that I remember what the method is.
Here's the Tech Support note: http://support.sas.com/techsup/notes/v8/3/466.html

cynthia

View solution in original post


All Replies
Super User
Posts: 9,867

Re: Incorrect Pagination-SAS 9.3 - ods escapechar and Proc Report (break after statement)

[ Edited ]

1) can you use ^{thispage}  ^{lastpage}    ?

2)Could try this way ?

 

proc report data = test nowindows;
column a;
define a / order;

compute before _page_;
line @3 'Page ^{pageof}' ;
endcomp;

break after a / page; 
run;
New Contributor
Posts: 4

Re: Incorrect Pagination-SAS 9.3 - ods escapechar and Proc Report (break after statement)

While trying 1) ^{thispage}  ^{lastpage}, it shows same result as ^{pageof}. 

and 2) compute block doesn't show page no.

 

Thank you for suggestions. 

-Devarshi

 

 

 

Solution
‎03-10-2016 09:32 PM
SAS Super FREQ
Posts: 8,819

Re: Incorrect Pagination-SAS 9.3 - ods escapechar and Proc Report (break after statement)

Hi:
I thought there was a Tech Support note about this. Generally, all you have to do is scroll to the bottom of the file using Page Down to force Word to re-paginate the document. I think there's an 'F' key to do it, but I'm not sure that I remember what the method is.
Here's the Tech Support note: http://support.sas.com/techsup/notes/v8/3/466.html

cynthia
New Contributor
Posts: 4

Re: Incorrect Pagination-SAS 9.3 - ods escapechar and Proc Report (break after statement)

Thanks Cynthia. 

Yes, the Tech Support note is correct. I have to scroll down all the way at the bottom and when come back to first page it re-paginates. But for proper pagination that needs to be done every time I open the file. So I think trying different method for pagination will be better way for creating multiple outputs. 

 

Thanks again!

-Devarshi

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 607 views
  • 0 likes
  • 3 in conversation