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-73
Clauses in Message Description Entry
Example 1
Message MSG1 has a fixed length of two characters.
01 MSG1 PIC X(2) MESSAGE FORMAT IS FIXED ...
This message could also have been described as:
01 MSG1 PIC X(2) ...
When the MESSAGE FORMAT clause is omitted, the message length is fixed by
default.
Example 2
Message MSG2 can contain up to five characters of data. The actual number of data
characters it contains is kept in a one-byte count; this count is not included in the size of
the message specified in its PICTURE clause.
01 MSG2 PIC X(5) MESSAGE FORMAT IS VARYING1 ...
Example 3
Message MSG3 can contain up to eight characters of data. The actual number of
characters is kept in a two-byte count that is not included in the message size specified
in the PICTURE clause.
01 MSG3 PIC X(8) MESSAGE FORMAT IS VARYING2 ...
Example 4
The following example has a DELIMITED message format and uses the field delimiters
to process the message.
WORKING-STORAGE SECTION.
01 WS-MSG4-RECORD-1.
02 WS-LENGTH-1 PIC 9(4) COMP.
02 WS-RECORD-1-GROUP.
03 WS-RECORD-1 PIC X(1)
OCCURS 1 TO 16 TIMES
DEPENDING ON WS-LENGTH-1.
01 WS-MSG4-RECORD-2.
02 WS-LENGTH-2 PIC 9(4) COMP.
02 WS-RECORD-2-GROUP.
03 WS-RECORD-2 PIC X(1)
OCCURS 1 TO 16 TIMES
DEPENDING ON WS-LENGTH-2.
MESSAGE SECTION.
01 MSG4 MESSAGE FORMAT IS DELIMITED
MESSAGE-DELIMITER IS OFF
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.