COBOL Manual for TNS/E Programs (H06.03+)
Creating and Compiling HP COBOL Source
Programs
HP COBOL Manual for TNS/E Programs—520347-003
22-20
Creating or Altering a COPY or SOURCE Library
To use the library in Example 22-2 as a SOURCE library, include a line like this in your
source program:
?SOURCE file-name (NAMEREC,ZOO-FILE)
where file-name is the name of the file containing the library text in Example 22-2.
The effect is the same as including these lines in your source program:
01 NAME-REC.
03 LAST-NAME PICTURE X(15).
03 M-I PICTURE X(1).
03 FIRST-NAME PICTURE X(15).
03 TITLE PICTURE X(5).
ASSIGN TO "$A0101.ZOO.ROSTER"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS ANIMAL-NUMBER
ALTERNATE RECORD KEY IS SPECIES WITH DUPLICATES
ALTERNATE RECORD KEY IS HABITAT WITH DUPLICATES
FILE STATUS IS ZOO-STAT
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 a HP COBOL source
program (see Creating or Altering an HP COBOL Source Program). Follow the library
format described in Library Format (see Example 22-2).
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.










