COBOL Manual for TNS and TNS/R Programs
Creating and Compiling HP COBOL Source
Programs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
22-24
Creating or Altering a COPY or SOURCE Library
01 STARTING-EMPLOYEE PICTURE 9(6).
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).