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-74
Clauses in Message Description Entry
Message MSG4 consists of two fields and can contain up to 32 characters of data. The
actual length of each field, in bytes, is placed into a separate Working-Storage location,
WS-LENGTH-1 and WS-LENGTH-2 respectively. The field delimiter is not stored in
the target Working-Storage location, WS-RECORD-1 or WS-RECORD-2. The field
delimiter is not reflected in the RESULTING COUNT value.
Example 5
The following example has a DELIMITED message format but inputs the entire
message without regard to delimiter processing.
WORKING-STORAGE SECTION.
01 WS-MSG5.
05 WS-RECORD-LENGTH PIC 9(4) COMP.
05 WS-DATA-GROUP.
10 WS-DATA PIC X(1)
OCCURS 1 TO 1000 TIMES
DEPENDING ON WS-RECORD-LENGTH.
MESSAGE SECTION.
01 MSG5 MESSAGE FORMAT IS DELIMITED
MESSAGE-DELIMITER OFF
FIELD-DELIMITER OFF.
05 MS-RECORD PIC X(1000) USING WS-DATA
RESULTING COUNT IS WS-RECORD-LENGTH.
Message MSG5 can contain up to 1000 characters of data. The actual length of the
field, in bytes, is placed into a separate Working-Storage location (WS-RECORD-
LENGTH).
The Procedure Division usage would be to reference WS-DATA-OCCURS, using the
value of WS-RECORD-LENGTH as the value for the actual limit of occurrences.
OCCURS/OCCURS DEPENDING ON Clauses
The OCCURS and OCCURS DEPENDING ON clauses specify a series of fixed or
variable-length fields within a message. These clauses can be specified at the group or
field level.
The OCCURS clause can be nested three levels deep. The OCCURS DEPENDING ON
clause cannot be nested. However, the OCCURS clause can be nested within the
OCCURS DEPENDING ON clause.
There is no limitation to how many times the OCCURS or OCCURS DEPENDING ON
clauses can be repeated within a message.
OCCURS { num-lit-1 TIMES }
{ }
{ num-lit-2 TO num-lit-3 TIMES }
{ DEPENDING [ON] num-name-1 }