COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

Creating or Altering a COPY or SOURCE Library
You can create a COPY or SOURCE library with an HP editor or with Data Definition Language
(DDL). You can alter a COPY or SOURCE library with an HP editor unless it was created with DDL,
in which case you must alter it with DDL.
Topics:
Using an HP Editor
Using Data Definition Language (DDL)
Using an HP Editor
To create or alter a COPY or SOURCE library with either HP editor, EDIT or TEDIT, use the same
method as you would use to create or alter an HP COBOL source program (see Creating or Altering
an HP COBOL Source Program). Follow the library format described in Library Format (page 506)
(see Example 230).
Using Data Definition Language (DDL)
Data Definition Language (DDL) is a language with which you describe the data structures of a
database. The DDL compiler reads your description and generates a data declaration library (a
COPY library) for the database and a File Utility Program (FUP) command file for building the
database files. DDL also lets you create and maintain a data dictionary for your database. Because
DDL can create data declarations for other programming languages, it facilitates sharing data
structures in mixed-language programs.
Figure 30 DDL Input and Output
Topics:
Describing the Data Structures
Data Declaration (COPY) Library
File Utility Program (FUP) Commands
Data Dictionary
Describing the Data Structures
You describe the data structures of your database with DEFINE statements. Each data item can be
an elementary item or a data structure. A data item can be composed of explicit, COBOL-like
definitions or it can refer to data items defined earlier in the data dictionary. In the latter case, you
define records with RECORD statements. A record definition can include both explicitly defined
data items and data items defined earlier in the data dictionary.
In Example 231, note the absence of the level number 01.
Creating or Altering a COPY or SOURCE Library 759