BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
thakkar
Fluorite | Level 6

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!
1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
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

4 REPLIES 4
Ksharp
Super User

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;
thakkar
Fluorite | Level 6

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

 

 

 

Cynthia_sas
SAS Super FREQ
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
thakkar
Fluorite | Level 6

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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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