PAGNBR (Page Number) Keyword in Printer Files

Use this field-level keyword to specify the location of an unnamed, 4-digit, zoned decimal field to contain the page number. Specify only the PAGNBR keyword, the location of the field (the location of the field can be either position only, or line number and position), and, optionally, the CHRSIZ, COLOR, FONT, HIGHLIGHT, UNDERLINE, or TEXT keyword.

This keyword has no parameters.

When the printer file is opened, the OS/400 program sets the page count to zero and increases it by one before it prints each new page. This is done even if you do not specify the PAGNBR keyword. The page number is printed each time any field for which the PAGNBR keyword is specified is printed. The page number does not increase beyond 9999; it stays 9999 until it is reset. To reset the page count, condition PAGNBR with option indicators. The OS/400 program resets the page number when your program selects PAGNBR (see Specifying on One Line with No Indicators in Printer Files).

You can also specify EDTCDE or EDTWRD with the PAGNBR keyword.

Option indicators are valid for this keyword.

You can specify the field (location only) and the keyword on one line with no indicators or on separate lines with separate indicators. The following sections explain the differences.