The ADVANCING phrase controls positioning of the output record on the page.
It only applies to device type PRINTER. The following rules apply:
- When BEFORE ADVANCING is specified, the
line is printed before the page is advanced.
- When AFTER ADVANCING is specified, the
page is advanced before the line is printed.
- When identifier-2 is specified, the page is advanced the number of lines
equal to the current value in identifier-2. Identifier-2 must be an integer
data item.
- When integer-1 is specified, the page is advanced the number of lines
equal to the value of integer-1.
- Integer-1 or the value in identifier-2 may be zero.
- When mnemonic-name is specified, a system-specific action takes place. Mnemonic-name must be equated
with environment-name-1 in the SPECIAL-NAMES paragraph (valid environment-names
are listed in Table 1). For more information on acceptable values for mnemonic-name,
see SPECIAL-NAMES Paragraph.
- When PAGE is specified, the record is printed on the logical page BEFORE
or AFTER (depending on the phrase used) the device is positioned to the next
logical page. If PAGE has no meaning for the device used, then BEFORE or AFTER
(depending on the phrase specified) ADVANCING 1 LINE is provided.
If the
FD entry contains a LINAGE clause, the repositioning is to the first printable
line of the next page, as specified in that clause. If the LINAGE clause is
omitted, the repositioning is to line 1 of the next succeeding page.
LINAGE-COUNTER Rules: If the LINAGE clause is specified
for this file, the associated LINAGE-COUNTER special register is modified during the execution of
the WRITE statement, according to the following rules:
- If ADVANCING PAGE is specified, LINAGE-COUNTER is reset to 1.
- If ADVANCING identifier-2 or integer-1 is specified, LINAGE-COUNTER is
increased by the value in identifier-2 or integer-1.
- If the ADVANCING phrase is omitted, LINAGE-COUNTER is increased by 1.
- When the device is repositioned to the first available line of a new page,
LINAGE-COUNTER is reset to 1.
When this phrase is omitted, automatic line advancing is provided, as if
the user had written AFTER ADVANCING 1 LINE.