COBOL Manual for TNS and TNS/R Programs
Data Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
7-90
VALUE Clause
°
Nonnumeric data items
If the data item is nonnumeric, literal must be nonnumeric or a figurative
constant. The keyword ALL can appear in the figurative constant.
The value of literal cannot exceed the size indicated by the data item’s
PICTURE clause. Editing characters in the PICTURE clause are included
when the size of the item is determined, but do not effect initialization;
therefore, the value of literal must conform to the edited form. Initialization
follows standard alignment rules for alphanumeric data items. The BLANK
WHEN ZERO and JUSTIFIED clauses do not affect initialization.
°
Pointer data items
If the data item is described with a USAGE POINTER clause, literal must
have the value NULL or NULLS.
°
Data structures
If the data item is a data structure, literal must be either a figurative
constant or a nonnumeric literal. A data structure is initialized without
consideration for its subordinate elementary or data structure items.
If the data structure is described with one or more OCCURS clauses, every
occurrence of the repeated item is initialized with the specified value. If an
OCCURS clause has a variable number of occurrences, the initialization
proceeds as if the data structure has its maximum number of occurrences.
Example 7-20. VALUE Clauses
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.