Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)
Data Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual—426750-003
5-74
Clauses in Message Description Entry
•
In the DELIMITED and FIXED-DELIMITED message formats, the PIC 1 data type
is allowed only if FIELD-DELIMITERS is OFF. SCREEN COBOL will not report this
violation as an error.
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










