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-83
Clauses in Message Description Entry
On output, in the above example, the data is fetched from where the x variables appear.
This example illustrates the rule of left to right processing from PIC X(n) fields and
right to left processing from PIC 9(n) fields.
PRESENT IF Clause
The PRESENT IF clause defines a field within a message to be optionally present based
on the value of a control field.
•
The control field and the optionally present field must be in the same 01 message
structure.
•
The control field must precede the optionally present field. The value of the control
field determines the presence or absence of the optionally present field.
You can use the PRESENT IF clause only with a message format that allows for fields
within a message to be optionally present based upon the value of a previously
processed message field.
The PRESENT IF clause allows you to send or receive only the data that is actually
present, thus reducing the amount of data that must be transmitted.
control-field
is a field in the Message Section that describes the presence or absence of the
associated optionally present field.
A TRUE condition is produced if control-field is a numeric data item that
contains a value other than zero or if control-field is a nonnumeric data item
that contains a character other than blank. When control-field is TRUE, the
optionally present field is considered to be present.
A FALSE condition is produced if control-field is a numeric data item that
contains a zero or if control-field is a nonnumeric data item that contains a
blank. When control-field is FALSE, the optionally present field does not
exist.
NOT
causes the initial Boolean value for control-field to be complemented.
The following rules apply:
•
The PRESENT IF clause can be used only with DELIMITED messages.
Specification of PRESENT IF with other message formats will result in a syntax
error. The DELIMITED message format allows you to process variable-length
fields for the data, thus, conserving on data transmission.
•
The PRESENT IF clause can be specified at the Message Section group level or at
the field level. When the PRESENT IF clause is specified at the group level, it
causes the condition to be propagated to the fields that belong to this group. These
PRESENT IF [ NOT ] control-field