BookmarkSubscribeRSS Feed
SanjayM
Calcite | Level 5
Can I reset Page numbers on PAGEBREAKS

I have a consolidated report for all departments. Report was generated as text file from EG project using List data. I am using PAGE BREAK on Department Code.

Can I reset the Page number to 1 after every page break
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
Between EACH procedure, you can reset PAGENO to 1 :
[pre]
options pageno=1;
proc print data=sashelp.shoes (obs=50);
run;

options pageno=1;
proc print data=sashelp.prdsale(obs=50);
run;
[/pre]

However, this technique will not work for HTML.

And, although this technique will work for LISTING, RTF and PDF, the pages will start at 1 and increment to the end. In other words, the pages generated "internally" by a procedure cannot be restarted (as you have discovered). For example, in the code below, the PAGEBY will cause every Region to start on a new page. However, the page numbers will start at 1, but will be consecutively numbered (about 12-13 pages for all of SASHELP.SHOES):
[pre]
options pageno=1;
proc print data=sashelp.shoes;
by region;
pageby region;
run;
[/pre]

Unless you do something like this:
[pre]
options pageno = 1;
proc print data=sashelp.shoes;
where region = 'Asia';
run;

options pageno = 1;
proc print data=sashelp.shoes;
where region = 'Canada';
run;
[/pre]

cynthia

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1551 views
  • 1 like
  • 2 in conversation