A record is a collection of items. An item can contain data; it can contain control information; or it can be a data set, set, subset, Access, remap, or link item. The record description names and describes each item in the record.
Items can contain other items. DASDL does not use level numbers like those of COBOL; however, when a COBOL program that invokes the database is compiled, the database description is automatically included and level numbers are assigned to each item. Disjoint data sets, sets, and subsets are assigned a level number of 1. All other items are assigned a level number one greater than that of the group item or data set which contains them.
An occurring item cannot be the only item in a disjoint data set or in the field part of a variable-format record.
You can declare data items, control items, link data items, and group data items that are 1 to 30 bytes in length.
The following diagram illustrates the syntax for describing records:
<record description>
┌◄──────────── ; ────────────┐ ── ( ─┴─┬─<control item>─────────┬─┴─┬─────┬─ ) ───────────────────────► ├─<data item>────────────┤ └─ ; ─┘ ├─<data set>─────────────┤ ├─/1\─<filler data item>─┤ ├─<group data item>──────┤ ├─<link data item>───────┤ ├─<remap>────────────────┤ └─<set-subset-Access>────┘ ►─┬──────────────────────────┬─┬──────────────────────────────┬────────┤ ├─────┬─<verify condition>─┘ ├─────┬─<variable-format part>─┘ └─ , ─┘ └─ , ─┘
Except for remaps and set-subset-Access, each of the elements of the syntax diagram are described under their own heading in this section. For more information on remaps, refer to Using Remaps and Logical Databases for Security and Data Independence. For more information on sets, subsets, and accesses, refer to Sets, Subsets, and Accesses.
Examples
The following example illustrates the COBOL declarations necessary to access the data set defined in the DASDL description:
DASDL Example
D DATA SET ( A ALPHA(3); B BOOLEAN; C GROUP ( R REAL; G GROUP ( N NUMBER(S5,2); ); ); E UNORDERED DATA SET ( X ALPHA(4); Y FIELD(4); ); );
COBOL Example
DB TEST ALL. * 01 D STANDARD DATA SET( # 2). * 02 A PIC XXX DISPLAY. * 02 B BOOLEAN. * 02 C. * 03 R COMP-4. * 03 G. * 04 N PIC S999V99 COMP-2. * 02 E UNORDERED DATA SET( # 3). * 03 X PIC X(4) DISPLAY. * 03 Y FIELD SIZE IS 04 BITS.