Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)

Data Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual426750-001
5-63
USER CONVERSION and PRESENT IF Restrictions
Each field level item, with the exception of the FILLER item, must have a
PICTURE clause and a TO, FROM, or USING clause.
The following example shows the use of the PICTURE clause and the FROM clause in
a multiple-field message.
WORKING-STORAGE SECTION.
01 WS-MSG.
05 WS-GROUP.
10 WS-FLD1 PIC X(10).
10 WS-FLD2 PIC X(10).
MESSAGE SECTION.
01 MS-MSG.
05 MS-GROUP.
10 MS-FLD1 PIC X(10) FROM WS-FLD1.
10 MS-FLD2 PIC X(10) FROM WS-FLD2.
USER CONVERSION and PRESENT IF Restrictions
The USER CONVERSION clause can be applied to 01 level items, group items, and
field items. When the USER CONVERSION clause is used on the 01 level item or
group item, it will be applied to the lower-level items as well, except under the
following condition: if the lower-level item itself has a USER CONVERSION clause,
then the upper level USER CONVERSION clause is overridden by the lower level
USER CONVERSION clause.
Likewise, the PRESENT IF clause is propagated from one level (01 level or group item)
down to any of its subordinate members. PRESENT IF clauses declared by subordinate
members will override any previously propagated PRESENT IF attribute.
Message Description Entry Usage
The message format defined by the message description entry acts as a template through
which the data is mapped as it is moved between the paired Working-Storage Section
and Message Section PICTURE clauses. The purpose of this template is to order,
format, and convert the data. The same message description can be used for both input
and output.
The following is an example of a paired Working-Storage Section data description entry
and Message Section message description entry:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-MSG
05 WS-MSG-FLD1 PIC X(10) VALUE IS 10.
05 WS-MSG-FLD2 PIC X(10) VALUE IS 20.
05 WS-MSG-FLD3 PIC X(5) VALUE IS 30.
05 WS-MSG-FLD4 PIC 9(5) COMP VALUE IS 12345.