PAGE-COUNTER Rules

  1. PAGE-COUNTER is the reserved word used to reference a special register that is automatically created for each report specified in the report section. (See the section Special Register PAGE-COUNTER.)
  2. In the report section, a reference to PAGE-COUNTER can appear only in a SOURCE clause. In the Procedure Division, PAGE-COUNTER can be used in any context in which a data item with an integer value can appear.
  3. If more than one PAGE-COUNTER exists in a program, PAGE-COUNTER must be qualified by a report-name whenever it is referenced in the Procedure Division.

    In the report section an unqualified reference to PAGE-COUNTER is qualified implicitly by the name of the report in whose RD entry the reference is made. Whenever the PAGE-COUNTER of a different report is referenced, PAGE-COUNTER must be explicitly qualified by the report-name associated with the different report.

  4. Execution of the INITIATE statement causes the RWCS to set the PAGE-COUNTER of the referenced report to one.
  5. PAGE-COUNTER is automatically incremented by one each time the RWCS executes a page advance.
  6. PAGE-COUNTER can be altered by Procedure Division statements.