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
SAS Super FREQ
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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 1 reply
  • 843 views
  • 0 likes
  • 2 in conversation