The PAGESEQ option identifies a record that controls page numbering.
PAGESEQ filename id
The PAGESEQ option provides a way in which successive uses of the same report can produce sequentially numbered pages allowing, for example, separate monthly business reports to be assembled into a single item. The option is ignored for reports directed to the screen.
The PAGESEQ option specifies the name of a file and a record within that file. This record should contain a single field which holds the page number to be applied to the first page of the report. The query processor will retain a lock on this record for the duration of the query and will update it on completion to contain a value one greater than the number of the final page in the report.
If the control record does not exist, a default page number of 1 is used for the first page and the record will be created when the query terminates.
LIST MONTHLY.INVOICES PAGESEQ SEQFILE INV LPTR
would produce a report of the MONTHLY.INVOICES file, using the value in SEQFILE INV as the start page number and updating this value on completion of the report.