BookmarkSubscribeRSS Feed
deleted_user
Not applicable
How do I insert pagenumbers x of y for multi page report using the proc report procedure.

Thanks,
APS
1 REPLY 1
Cynthia_sas
Diamond | Level 26
Hi:
See Example 2 in this forum posting:
http://support.sas.com/forums/thread.jspa?threadID=1796&tstart=0

It uses ODS ESCAPECHAR.

An afterthought: The Page X of Y technique shown in the above post is a feature of ODS that can be used in a SAS title or SAS footnote statement -- that means you could use the capability with ANY SAS procedure -- not just PROC REPORT.

Here's a different example program that shows using different procs for Page X of Y -- not just PROC REPORT.

cynthia
[pre]
options nodate nonumber;
ods rtf file='c:\temp\pagenum.rtf';
ods pdf file='c:\temp\pagenum.pdf';

ods escapechar='~';

title1 j=r 'Page ~{thispage} of ~{lastpage}';
footnote j=c '--~{thispage}--';

proc freq data=sashelp.shoes;
title2 'Proc Freq';
tables region;
run;

proc means data=sashelp.shoes min mean max;
title2 'Proc Means';
class subsidiary;
var sales;
run;

proc report data=sashelp.shoes nowd;
title2 'Proc Report';
column product sales inventory returns;
define product/group;
rbreak after /summarize;
format sales inventory returns comma14.2;
run;

proc tabulate data=sashelp.shoes f=comma10.;
where region in ('Asia', 'Pacific', 'Canada');
title2 'Proc Tabulate';
class subsidiary product;
var returns;
table subsidiary all,
Returns='Product Returns'*(product=' ' all);
keylabel sum=' '
all='Total';
run;
ods _all_ close;
title;
ods listing;

[/pre]

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1356 views
  • 0 likes
  • 2 in conversation