RPG/400 Help
Remember the following rules when using the PAGE fields:
- When a PAGE field is specified in the output specifications, without being
defined elsewhere, it is assumed to be a four-digit, numeric field with zero
decimal positions.
- Page numbering, unless otherwise specified, starts with 0001; and 1
is automatically added for each new page.
- To start at a page number other than 1, enter that page number in a field
of an input record and name that field PAGE in positions 53 through 58, or use
a calculation operation such as Z-ADD. The number entered in the PAGE
field should be one less than the starting page number. For example, if
numbering starts with 24, enter a 23 in the PAGE field. The PAGE field
can be of any length but must have zero decimal positions (see Figure "Page Record Description"). Any entry in the
PAGE field should be right-adjusted, such as 0023.
- Page numbering can be restarted at any point in a job. The
following methods can be used to reset the PAGE field:
- Specify blank-after (position 39 of the output specifications).
- Specify the PAGE field as the result field of an operation in the
calculation specifications.
- Specify output indicators in the output specifications (see Figure "Resetting the PAGE Fields to Zero"). Output
indicators cannot be used to control the printing of a PAGE field, because a
PAGE field is always written.
- Specify the PAGE field as an input field as shown in Figure "Page Record Description".
- Leading zeros are automatically suppressed (Z edit code is assumed) when a
PAGE field is printed unless an edit code, edit word, or data format (P/B/L/R
in position 44) has been specified. Editing and the data format
override the suppression of leading zeros.
- PAGE can be specified in input or calculation specifications, and can be
of any length. When the PAGE field is defined in input and calculation
specifications, it is treated as a field name in the output specifications and
zero suppression is not automatic.
Figure 67. Page Record Description
*...1....+....2....+....3....+....4....+....5....+....6....+....7...
IFilenameSqNORiPos1NCCPos2NCCPos3NCC.PFromTo++DField+L1M1FrPlMnZr...
IINPUT PG 50 1 CP
I 2 50PAGE
Figure 68. Resetting the PAGE Fields to Zero
*...1....+....2....+....3....+....4....+....5....+....6....+....7...
OName++++DFBASbSaN01N02N03Field+YBEnd+PConstant/editword+++++++++...
O* When indicator 15 is on, the PAGE field is set to zero and 1 is
O* added before the field is printed. When indicator 15 is off, 1
O* is added to the contents of the PAGE field before it is printed.
OPRINT H 01 L1
O 15 PAGE 1 75
[ Top of Page | Previous Page | Next Page | Table of Contents ]
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.