COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

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 53 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.
BASED Clause
The BASED clause specifies that the record is a BASED item. The compiler does not allocate storage
for a BASED item; instead you associate the BASED item with another data item or with dynamically
allocated storage at run time. Only level-01 and level-77 items in the Working-Storage,
Extended-Storage, and Linkage Sections can be BASED items.
The compiler allocates an implicit pointer for each BASED item. The initial state for this implicit
pointer is NULL. Use the SET ADDRESS statement to associate the BASED item with another data
item. Use the ALLOCATE statement to associate the BASED item with dynamically allocated storage.
Usage Considerations:
Use only when the STANDARD 2002 directive is in effect.
BASED Clause Cannot be Used With EXTERNAL Clause
You cannot specify the BASED clause in a data description entry that includes the EXTERNAL
clause.
Use With VALUE Clause
You can use the VALUE clause with a BASED item, but the VALUE clause has no effect unless
the ALLOCATE statement with the INITIALIZED phrase is used with the item.
220 Data Division