Data Description Entry Skeleton
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




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.
General Rules
-
Format 3 is used for each condition-name. Each
condition-name requires a separate entry with level-number 88. Format 3
contains the name of the condition and the value, values, or range of values
associated with the condition-name. The condition-name entries for a particular
conditional variable must immediately follow the entry describing the item with
which the condition-name is associated. A condition-name can be associated with
any data description entry which contains a level-number except the following:
- Another condition-name.
- A
level 66 item.
- A group containing items with descriptions including
JUSTIFIED, SYNCHRONIZED or USAGE (other than USAGE IS DISPLAY).
- An index

or
pointer
data item (see the topic
The USAGE
Clause).
A constant-name.

Condition-names can be
associated with internal floating-point items.
Condition-names can be associated
with external floating-point items.
Format 4 defines a constant-name,
which is a symbolic name representing a constant value assigned to it when the
source code is passed through your COBOL system. Your COBOL system replaces
each reference to a constant-name by its value.
The TYPEDEF clause allows you to
declare a group or elementary data description as a type definition, which
allows instances of that data description to be declared as data items using
data-name-1 as typedef-name-1 in the USAGE clause. The type definition itself
is not a data item with allocated storage.
If the TYPEDEF clause is specified
at a group level, the components of the type definition are implicitly declared
for any data item of that type and are referenced using the usual COBOL rules
of qualification for the data item.