Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)

Procedure Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual426750-001
6-57
PRINT SCREEN Statement
PRINT SCREEN Statement
The PRINT SCREEN statement causes the current screen image to be printed on an
attached or nonattached printer.
PRINT SCREEN cannot be used by programs communicating with intelligent devices.
ON ERROR
provides a point of control if an error occurs while attempting the print operation.
The special register TERMINATION-STATUS is set with an error code indicating
the type of error; the imperative-statement is then executed.
If the clause is omitted and an error occurs, default system action is taken.
imperative-statement
is the statement to be executed if an error is detected.
If an attached printer has been specified via the PATHCOM SET TERM command for
the 6520 terminal, the screen image is directed to a printer attached directly to the
terminal (the 6524 terminal includes an attached printer).
If an attached printer has been specified via the PATHCOM SET TERM command for
the IBM3270 terminal, the screen image is directed to the device specified in the special
register TERMINAL-PRINTER; this device must be attached to the same control unit
as the terminal.
If a printer is not attached, printing occurs on the operating system file specified in the
special register TERMINAL-PRINTER. Device types terminal, printer, and process are
supported.
If a printer is not attached, a screen image that is printed with PRINT SCREEN can be
different from the screen image that is displayed, because the print operation does not
read the screen to form the screen image. Instead, the print operation forms the screen
image by using the screen description contained in the SCREEN COBOL object file and
the Working-Storage items associated with the screen.
The following items indicate how screen reconstruction from Working-Storage items
can cause differences in the displayed and printed screens (for printers that are not
attached):
A screen field defined as HIDDEN in the Screen Section is not printed even though
the field is changed to be displayed during execution. If you want to have a screen
field initially hidden and subsequently printed, do not define the item as hidden.
Turn the HIDDEN attribute on and off by using a TURN statement during
processing.
An unexpected value might be printed because the value in the Working-Storage
item has never been displayed or contains data that is different from what is
presently displayed on the screen.
PRINT SCREEN [ ON ERROR imperative-statement ]