Desktop productivity for business analysts and programmers

Reset Page numbers

Reply
Frequent Contributor
Posts: 97

Reset Page numbers

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
SAS Super FREQ
Posts: 8,818

Re: Reset Page numbers

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
Ask a Question
Discussion stats
  • 1 reply
  • 169 views
  • 0 likes
  • 2 in conversation