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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 1777 views
  • 1 like
  • 2 in conversation