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

Data Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual426750-003
5-84
Clauses in Message Description Entry
Example
On input, if a PIC 1(9) Message Section item is placed into a PIC X(2) or PIC 9(2)
Working-Storage item, the resulting values are:
PIC X(2) bit positions: 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
resulting X(2) data: x x x x x x x x x 0 0 0 0 0 0 0
PIC 9(2) bit positions: 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
resulting 9(2) data: 0 0 0 0 0 0 0 x x x x x x x x x
The x represents a data bit from the Message Section item and the 0 is a binary zero
fill bit.
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.
PRESENT IF [ NOT ]
control-field