Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)
Data Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual—426750-003
5-75
Clauses in Message Description Entry
FIELD-DELIMITER IS ":".
05 MS-RECORD-1 PIC X(16) USING WS-RECORD-1
RESULTING COUNT IS WS-LENGTH-1.
05 MS-RECORD-2 PIC X(16) USING WS-RECORD-2
RESULTING COUNT IS WS-LENGTH-2.
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.










