Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

PAGE-COUNTER special register

PAGE-COUNTER is a special register that is defined automatically for each report described in the REPORT SECTION of the Data Division. The internal COBOL notation of this special register is PICTURE S9(7) USAGE COMPUTATIONAL-3.

When the INITIATE statement is executed for a report, the Report Writer increments the PAGE-COUNTER special register to 1 by means of an internal MOVE statement. As soon as the Report Writer issues a page advance - after printing the page footing and before printing the page heading - it increments the current contents of the special register PAGE-COUNTER by 1.

The PAGE-COUNTER register is freely accessible. That is, its contents may be modified as well as interrogated. The most common use of PAGE-COUNTER is for printing page numbers in page headings or page footings. For this purpose, the PAGE-COUNTER register is assigned to a printable item of the associated report, by the following SOURCE clause:


SOURCE IS PAGE-COUNTER [OF report-name]


Program references to PAGE-COUNTER must be qualified by the report name if the REPORT SECTION describes more than one report.