Definitions and Records
Data Definition Language (DDL) Reference Manual — 426798-002
5- 10
Syntax Elements
Level Number Guidelines
Level numbers must conform to the following rules:
•
The DEFINITION statement does not have a level number; it is implicitly at the
01 level.
•
Each group and field within a group DEFINITION statement has a level number to
indicate its relationship to other groups and fields within the group. A group of level
n includes all following groups and fields with level numbers greater than n up to
the next group or field of level n or less.
•
Level numbers need not be assigned sequentially. For instance, an 02 group can
contain two 05 fields with no intervening 03 or 04 levels.
•
If a field is defined by a TYPE clause that refers to a group definition, the field’s
level number replaces the implicit level 01 number of the referenced definition, and
the level numbers of the definition’s member fields are adjusted accordingly.
•
If a field is defined by a TYPE clause that refers to a previous definition, the level
number of any element following the field must be less than or equal to the level
number of the field.
Definition Length Guidelines
A definition’s length must conform to the following rules:
•
If a definition is used only for working storage, its length or the length of any field
within the definition is limited to 32,767 bytes.
•
If a RECORD statement refers to a definition, the length of the definition is subject
to the maximum record-length limitations.
•
The length of a definition is limited further by the following languages:
°
255 bytes for FORTRAN
°
5,000 bytes for TACL
°
32,766 bytes for Pascal
°
4,096 bytes for COBOL
DEFINITION Statement Examples
Following are examples of the different forms of the DEFINITION statement.
Field Definitions:
DEF company-name TYPE CHARACTER 30 NULL 0 .
DEF custnum PIC 9(6) HEADING "Customer/Number" .
DEF status TYPE ENUM BEGIN .
89 no-error .
89 read-error VALUE 3 .