Problem Note 39423: The BYPAGENO= option on the PROC REPORT statement might produce incorrect page numbers
The BYPAGENO= option specified on the PROC REPORT statement might produce incorrect page numbers.
The BYPAGENO= option might also cause the ^{thispage} ODS function to display an incorrect page value.
To circumvent the problem, run a separate PROC REPORT step for each BY variable value. The page number can be reset with the following OPTIONS statement placed prior to the PROC REPORT code:
options pageno=1;
Please see the code in the Full Code tab for an example of the circumvention.
Operating System and Release Information
SAS System | Base SAS | Solaris for x64 | 9.2 TS1M0 | 9.3 TS1M0 |
OpenVMS on HP Integrity | 9.2 TS1M0 | 9.3 TS1M0 |
Linux for x64 | 9.2 TS1M0 | 9.3 TS1M0 |
Linux | 9.2 TS1M0 | 9.3 TS1M0 |
HP-UX IPF | 9.2 TS1M0 | 9.3 TS1M0 |
64-bit Enabled Solaris | 9.2 TS1M0 | 9.3 TS1M0 |
64-bit Enabled HP-UX | 9.2 TS1M0 | 9.3 TS1M0 |
64-bit Enabled AIX | 9.2 TS1M0 | 9.3 TS1M0 |
Windows Vista | 9.2 TS1M0 | 9.3 TS1M0 |
Microsoft Windows XP Professional | 9.2 TS1M0 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | 9.3 TS1M0 |
Microsoft® Windows® for x64 | 9.2 TS1M0 | 9.3 TS1M0 |
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | 9.3 TS1M0 |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | 9.3 TS1M0 |
z/OS | 9.2 TS1M0 | 9.3 TS1M0 |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
The example code below creates a macro variable for each BY variable value. In a macro %DO loop, the page number is reset and a PROC REPORT with a WHERE statement is run for each BY variable value.
options nobyline orientation=landscape;
ods escapechar='^';
proc sort data=sashelp.shoes out=sorted;
by region;
run;
data _null_;
set sorted;
by region;
if first.region then do;
count+1;
call symput('region'||trim(left(count)),trim(left(region)));
end;
call symput('count',trim(left(count)));
run;
%macro loopit;
%do i=1 %to &count;
options pageno=1;
proc report data=sashelp.shoes nowd;
by region;
where region="&®ion&i";
column subsidiary product stores sales inventory returns;
define subsidiary/order;
define product/display;
define stores/display;
define sales/display;
define inventory/display;
define returns/display;
title f=Arial h=14pt c=black 'Product Report for the #byval1 Region';
footnote j=center f=Arial h=8pt c=black "Page ^{thispage} of ^{lastpage}";
run;
%end;
%mend;
ods pdf file='c:\aaa.pdf';
%loopit
ods pdf close;
When the BYPAGENO= option is specified on the PROC REPORT statement, the resulting page numbers might be incorrect.
Type: | Problem Note |
Priority: | high |
Topic: | SAS Reference ==> Procedures ==> REPORT
|
Date Modified: | 2010-04-27 09:38:47 |
Date Created: | 2010-04-22 16:00:30 |