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-10
ACCEPT Statement
If a prompt is used and the field named in the PROMPT clause is an output field, the
ACCEPT statement causes the current value for the output field to be displayed before
reading the data input from the terminal. An output field named in the PROMPT clause
must be defined as FILLER or defined with a FROM or USING clause.
The data entered from the terminal is checked against the requirements given for the
field by its definition in the Screen Section of the Data Division. The TCP checks only
those fields referred to by the screen-identifier list in the ACCEPT statement.
If errors are discovered and the terminal is in block mode during the data checking, the
following occurs:
If a field with the ADVISORY clause is defined for the current screen, a DISPLAY
TEMPORARY of the advisory field automatically occurs using the standard error
message for the first error detected.
If the terminal is equipped with an audible alarm, the alarm sounds provided it was
not suppressed in the SCREEN-CONTROL paragraph of the Environment Division.
The first field in error has a temporary modification of its display attribute with the
standard error enhancement as declared in the SCREEN-CONTROL paragraph. The
program can specify that all fields in error are enhanced (refer to the Input-Output
Section in Section 4).
The statement is restarted following these display operations.
If no data errors are found during the checking, the following occurs:
The validated data from all screen fields referred to and present, including all
required fields, is converted and moved into the TO or USING data items in
Working-Storage associated with the screen fields.
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 the completion is through an ESCAPE clause, none of the TO or USING data items is
affected. Data variables retain their values, and SHADOWED ENTER and RETURN
bits are undefined.
At the end of any accept operation, the NEW-CURSOR special register is set to zero
(row 0, column 0). This controls the placement of the cursor for the next accept
operation and causes the default position to be the first field of the current ACCEPT
statement.
The ACCEPT statement indicates the condition that caused completion by storing the
condition code value into the TERMINATION-STATUS special register. Each
completion condition is assigned a code value according to its position in the UNTIL or
ESCAPE clauses. The codes are assigned by considering the conditions of the UNTIL
and ESCAPE clauses to be a single list, and assigning each condition the code value that
corresponds to its position in the list. When several conditions are grouped together
with parentheses, they are all considered to occupy the same position; that is, all the
conditions within the parentheses receive the same code value, and the next condition