ENDPAGE condition

An input/output condition that is raised when a PUT statement results in an attempt to start a new line beyond the limit specified for the current page.

Enabled/Disabled status

Always enabled.

Result

When ENDPAGE is raised, the current line number is one greater than that specified by the PAGESIZE option (default is 60) so that it is possible to continue writing on the same page. The ON-unit can start a new page by execution of a PAGE option or a PAGE format item, which sets the current line to one.

Raised

When the line to be written has a line number that is one greater than the page size or when a line number option that specifies a line number less then the current line number is issued for the STREAM OUTPUT PRINT file identified by file-reference.

ENDPAGE can also be raised by a LINE option or LINE format item that specifies a line number less than the current line number.

Notes

ENDPAGE is raised only once per page, except when it is raised by the SIGNAL statement.

When the ON-unit does not start a new page, the current line number can increase indefinitely. If a subsequent LINE option or LINE format item specifies a line number that is less than or equal to the current line number, ENDPAGE is not raised, but instead, a new page is started with the current line set to one except when the current line number is equal to the specified line number, and the file is positioned on column one of the line. In this case, ENDPAGE is not raised.

When ENDPAGE is raised during data transmission on return from the ON-unit, data is written on the current line. This line might have been changed by the ON-unit.

When ENDPAGE results from a LINE or SKIP option on return from the ON-unit, the action specified by LINE or SKIP is ignored.

Syntax

ENDPAGE [file-reference]

Parameter

file-reference
A scalar reference; if omitted, assumed SYSIN.

Other Information

Condition code
90
Implicit action
Starts a new page. When the condition is signalled, execution is unaffected and continues with the statement following the SIGNAL statement.
Normal return

Returning from the ON-unit, returns to the point where the signal occurred and any additional output is then written to the stream. The default ON-unit puts a new page and returns.