Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)
Data Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
5-84
Clauses in Message Description Entry
fields can still specify their own PRESENT IF condition. The group level
PRESENT IF condition is overridden by the field level PRESENT IF condition.
•
PRESENT IF clause processing is the same for input and output operations.
•
PRESENT IF clauses can be logically nested to any depth. When PRESENT IF
clauses are nested, an optionally present field is present only if a second optionally
present field is present; the second optionally present field is present only if a third
optionally present field is present, and so forth.
•
The first level has to be present before you can use the second level, the second level
has to be present before you can use the third level, and so forth.
•
To conveniently determine if a conditionally present field is present, specify a
FIELD STATUS clause on the field. You can test the shadow data item in the
FIELD STATUS structure to determine the presence of the field. Refer to the
FIELD STATUS clause for details.
•
An alternative, although less desirable, method of testing for the presence of a field
is to make explicit reference to the Boolean values of the Working-Storage data item
associated with the control-field parameter in the PRESENT IF clause.
•
You must use caution when setting up the data structures to use the PRESENT IF
clause with the DELIMITED message format. It is possible for one data field to be
substituted for another in an input message without any possibility of detection of
the unintended substitution by the TCP.
The following example shows where such a substitution could take place.
WORKING-STORAGE SECTION.
01 WS-MSG.
02 WS-PIF-1 PIC 9(1) COMP.
02 WS-PIF-2 PIC 9(1) COMP.
02 WS-F1 PIC X(8).
02 WS-F2 PIC X(8).
MESSAGE SECTION.
01 MSG MESSAGE FORMAT IS DELIMITED
FIELD-DELIMITER IS OFF.
02 PIF-1 PIC 1(1) TO WS-PIF-1.
02 PIF-2 PIC 1(1) TO WS-PIF-2.
02 F1 PIC X(8)
PRESENT IF PIF-1
TO WS-F1.
02 F2 PIC X(8)
PRESENT IF PIF-2
TO WS-F2.