Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)
Data Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual—426750-003
5-21
VALUE Clause
VALUE Clause for Data Initialization
Format 1 of the VALUE clause is used to assign an initial value to a Working-Storage
item at the time the program is entered. The VALUE clause must not conflict with other
clauses in the data description of an item or in the data descriptions of other items
within the hierarchy. The following rules apply:
•
If the VALUE clause is omitted, the compiler initializes to zero numeric elementary
data items in the Working-Storage Section that do not use an OCCURS clause.
•
If an item is numeric, all literals of the VALUE clause must be numeric and must be
in the range of values set by the PICTURE string. Truncation of nonzero digits is
not allowed. A signed numeric literal applies only to a signed numeric PICTURE
string. Initialization follows standard alignment rules.
•
If an item is nonnumeric, all literals of the VALUE clause must be nonnumeric and
must not exceed the size of the PICTURE string. JUSTIFIED clauses are ignored.
•
The VALUE clause is not permitted in a data description entry that meets the
following criteria:
°
The entry contains an OCCURS or REDEFINES clause.
°
The entry is subordinate to an entry containing an OCCURS or REDEFINES
clause.
°
The entry has a variable size due to an OCCURS clause in a subordinate
entry.
•
If the VALUE clause is used for initialization at the group level, the literal must be a
figurative constant or a nonnumeric literal. The group area is initialized without
consideration for the individual elementary or other group items within this group.
Thus, the group should not have items with descriptions that include JUSTIFIED or
USAGE IS COMPUTATIONAL clauses. A VALUE clause cannot appear at the
subordinate levels within this group.
The following example illustrates the VALUE clause used for data initialization:
WORKING-STORAGE SECTION.
01 main-heading.
05 FILLER PIC XX VALUE SPACES.
05 FILLER PIC X(8) VALUE "DIVISION".
05 FILLER PIC XX VALUE SPACES.
05 FILLER PIC X(6) VALUE "REGION".
:
01 counters.
05 no-of-reads PIC 9(5) VALUE ZEROS.
05 no-of-writes PIC 9(5) VALUE ZEROS.
VALUE Clause for Condition-Name Entries
Format 2 of the VALUE clause is used with condition-name entries. A data item
assigned in the Data Division using a level 88 data item is a condition-name; the item










