ENFORM User's Guide

Tasks Involved in Developing Your Data Base
Developing the Data Base
2–6 058058 Tandem Computers Incorporated
Data Definition Language
Use the Data Definition Language (DDL) to create and manage data descriptions.
Using DDL allows you to describe the file, record, and data structures of a data base
and to create the dictionary used by ENFORM to obtain information about your data
base. DDL also optionally produces file creation source commands for use with the
File Utility Program (FUP) and data declaration source code for use with COBOL,
FORTRAN, and TAL programs. This guide describes DDL briefly; refer to the Data
Definition Language (DDL) Reference Manual for detailed information.
DDL statements define the data elements in a data base. A DDL RECORD statement
defines each record name and includes a DDL FILE IS clause that identifies the
Tandem disc file containing the actual data. The RECORD statement also describes
the record structure including field names, data categories, and optionally a heading
and display format for each field. If a record has key fields, the RECORD statement
defines the fields that are the primary and alternate key fields.
Figure 2-5 shows an example RECORD statement which describes the record named
parts. The FILE IS clause identifies the file storing the data as $mkt.sample.parts and
indicates that the file type is key-sequenced. The RECORD statement identifies the
fields named partnum, inventory, location, and price. All of these fields are numeric with
the exception of partname and location. (A numeric field is described as PIC 9...; an
alphanumeric field is described as PIC X...) The record description describes the
primary key as partnum and the alternate key as partname.
Figure 2-5. Sample DDL Record Description
RECORD parts.
FILE IS $mkt.sample. parts KEY-SEQUENCED.
02 partnum PIC 9(4).
02 partname PIC X(18).
02 inventory PIC 999S.
02 location PIC XXX.
02 price PIC 999999V99.
KEY IS partnum.
KEY "pn" IS partname.
END
When you use DDL to describe data, remember the following:
Associate only one record with each physical file with one exception:
unstructured FIND files can be associated with more than one record.
Describe only associated information in each record.
Avoid repeating groups in record descriptions. A record description with an
OCCURS clause causes a repeating group. If necessary, divide the file into two or
more files.