A data description entry specifies the characteristics of a particular item of data.
or the characteristics of a programmer-defined type of data which can then be used to specify the description of one or more particular items of data
.
A level 01 data description entry within the Working-Storage Section or File Section determines whether the data record and its subordinate data items have local names or global names.
A level 01 data description in the Working-Storage Section determines the internal or external attribute of the data record and its subordinate data items.
General Formats for Format 1
General Formats for 66 level item Format 2
General Formats for 88 level item Format 3
General Formats for 78 level item Format 4
Syntax Rules
- The level-number in Format 1 can be any number from 01 through 49 or 77.
- The clauses can be written in any order with two exceptions: the data-name-1 or FILLER clause
, if specified,
must immediately follow the level-number; the REDEFINES clause, when used, must immediately follow the data-name-1 or FILLER clause
if either is specified; otherwise it must immediately follow the level number
.
- The PICTURE clause must not be specified for the subject of a RENAMES clause or for an item whose usage is
- INDEX,
- OBJECT-REFERENCE,
- PROCEDURE-POINTER,
- PROGRAM-POINTER,
- POINTER,
- COMPUTATIONAL-1, COMPUTATIONAL-2,
- BINARY-CHAR, BINARY-SHORT, BINARY-LONG, BINARY-DOUBLE,
- FLOAT-SHORT, FLOAT-LONG,
- EVENT-POINTER, MONITOR-POINTER, MUTEX-POINTER, SEMAPHORE-POINTER or THREAD-POINTER.
For any other entry describing an elementary item, a PICTURE clause must be specified except as indicated in the rule that immediately follows.
- The PICTURE clause may be omitted for an elementary item when an alphanumeric or national literal is specified in a format 1 VALUE clause. A PICTURE clause is implied as follows:
- if the literal is alphanumeric, 'PICTURE X(length)'
- if the literal is national, 'PICTURE N(length)'.
where length is the length of the literal as specified in the topic
Literals in the chapter
Concepts of the COBOL Language.
- The words THRU and THROUGH are equivalent.
- The EXTERNAL clause can be specified only in data description entries in the Working-Storage Section whose level-number is 01.
- The EXTERNAL clause and the REDEFINES clause must not be specified in the same data description entry.
- The EXTERNAL clause and the THREAD-LOCAL clause must not be specified in the same data description entry.
- The GLOBAL clause can be specified only in data description entries whose level-number is 01.
- Data-name-1 must be specified for any entry containing the GLOBAL or EXTERNAL clause, or for record descriptions associated with a file description entry which contains the EXTERNAL or GLOBAL clause.
- The TYPEDEF clause can only be specified in data description entries whose level-number is 01.
- The TYPEDEF clause can only be used when data-name-1 is also specified. In other words, it cannot be used in the same data description with either an explicit or implicit FILLER clause.
Note that if the TYPEDEF clause is specified for a group item, subordinate data descriptions can be defined with either an implicit or explicit FILLER clause.
- The clauses SYNCHRONIZED, PICTURE, JUSTIFIED, and BLANK WHEN ZERO must not be specified except for an elementary data item.
The SYNCHRONIZED clause can be specified for a group item.
- Literal-6 and integer-1 must not be floating-point values, must not be negative values and must not be more than 18 digits.
- If literal-6 is used as part of an expression, it must be an integer.
- Data-name-2 and data-name-3 can be implicitly qualified.
- The VALUE clause must not be specified for data items of class index, object, or pointer.
- If the ANY LENGTH clause is specified, the only other clauses permitted are level-number, entry-name, PICTURE, and USAGE.