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-76
Clauses in Message Description Entry
OCCURS 1 TO 1024 TIMES
DEPENDING ON WS-Message-Length.
WORKING-STORAGE SECTION.
01 WS-Message-Length PIC 9(4) COMP.
01 WS-Message-Out
05 WS-Message-Data PIC X OCCURS 1 TO 1024 TIMES
DEPENDING ON WS-Message-Length.
MESSAGE SECTION.
01 Message-Out MESSAGE FORMAT IS DELIMITED
MESSAGE DELIMITER IS OFF
FIELD DELIMITER IS OFF.
05 Message-Data PIC X(1024)
RESULTING COUNT IS
WS-Message-Length
FROM WS-Message-Out.
•
The Working-Storage Section item associated with the FROM/TO/USING Message
Section item defined by an OCCURS clause must also have an OCCURS clause or
an OCCURS DEPENDING ON clause.
°
The number of occurrences of this Working-Storage Section item must be
greater than or equal to the number of occurrences of the Message Section item.
°
The nested structure of this Working-Storage Section item must be identical
with that of the Message Section item.
•
When an OCCURS DEPENDING ON clause is used to define a group or field in the
Working-Storage Section, that group or field must be the last item in the record.
•
If a message description entry in the Message Section contains several OCCURS
DEPENDING ON clauses, the message must be associated with several Working-
Storage Section 01 records, where each record can contain only one OCCURS
DEPENDING ON clause. For example:
WORKING-STORAGE SECTION.
01 WS-Msg4-Record-1.
05 WS-Length-1 PIC 9(4) COMP.
05 WS-Record-1 PIC X
OCCURS 1 TO 10 TIMES
DEPENDING ON WS-Length-1.
01 WS-Msg4-Record-2.
05 WS-Length-2 PIC 9(4) COMP.
05 WS-Record-2 PIC X
OCCURS 1 TO 10 TIMES
DEPENDING ON WS-Length-2.
Note. Another way of sending variable length messages uses the RESULTING COUNT
clause and results in faster processing. The following example accomplishes the same thing
as the previous one, but runs three times faster.