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;
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;
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
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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.