Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)

Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual426750-003
6-13
ACCEPT Statement
If a field with the ADVISORY clause is defined for the current screen, the advisory
field is displayed on the next line following the line with the error.
ACCEPT processing restarts after the error display operation. The prompt for the
field containing the error is redisplayed, and the cursor is positioned to accept the
correct input.
Not all errors are detected immediately. If an error is detected after subsequent screen
fields have been entered and processed, an error message is displayed and the
ACCEPT statement is restarted at the beginning. This is the same action that occurs
when a restart-input character is processed.
If no data errors are found during the checking, the following occurs:
The validated data from each screen field referred to is converted and moved as
the field is received from the terminal. The converted data is placed in either the
TO or USING data item in Working-Storage associated with the screen field. The
characteristics defined for a screen field such as PICTURE, UPSHIFT, and so
forth, apply to the converted value.
Absent screen input fields do not change the associated Working-Storage data
items unless specifically requested with the WHEN ABSENT field-characteristic
clause.
All SHADOWED fields associated with the input fields of the ACCEPT statement
have their ENTER and RETURN bits set appropriately. If these bits are checked
by a comparison statement, the ENTER and RETURN bits should be checked
together.
ACCEPT statement processing stores a condition code into the TERMINATION-
STATUS special register. A code value is assigned to each completion condition in the
same way as described previously for block mode.
The Break key for conversational terminals can be enabled to terminate an ACCEPT
operation. The Break key is enabled through the PATHCOM commands SET TERM
or SET PROGRAM TYPE in the Pathway system configuration. Also, for the Break
key to work on an ACCEPT, the SCREEN COBOL program must include an ESCAPE
ON ABORT clause in the ACCEPT statement. If the Break key is enabled and pressed
during an ACCEPT operation, the key has the same effect as entering the abort input-
control characters.
The following example illustrates an ACCEPT statement for conversational mode. The
value of TERMINATION-STATUS is 1 if valid input is entered, 2 for ABORT, and 2 for
TIMEOUT.
ACCEPT EMPLOYEE-SCREEN UNTIL INPUT
ESCAPE ON (ABORT, TIMEOUT 180).
PERFORM ONE OF
300-CHECK-NULL-NAME
200-EXIT-ROUTINE
DEPENDING ON TERMINATION-STATUS.