COBOL Manual for TNS and TNS/R Programs

Creating and Compiling HP COBOL Source
Programs
HP COBOL Manual for TNS and TNS/R Programs522555-006
22-29
Including Text From a COPY Library
Data Dictionary
A data dictionary is a set of files that documents the structure and location of each file
in your database. You can use the DDL compiler to translate DDL source statements
into a data dictionary, and then you can use the DDL compiler to modify the data
dictionary and re-create the data declaration (COPY) library. Alternatively, you can
keep the DDL source statements in a disk file, and when you want to change a data
description, you can recompile the data dictionary. The former procedure is faster
(because you are not recompiling the entire data dictionary); the latter procedure is
more straightforward.
For complete information about DDL, see the Data Definition Language (DDL)
Reference Manual.
Including Text From a COPY Library
Text from a COPY library is included in a HP COBOL source program with a COPY
statement. Although a COPY statement can appear anywhere in a HP COBOL source
program that a character-string or separator can appear, its most common uses are:
To copy descriptions of records or data structures into the Data Division
To copy the same small piece of code into several different programs (where
“small” means too small to merit being a separately compiled program)
To copy the occurrence number in an OCCURS clause into more than one data
description entry, as if it were a constant
Example 22-5. FUP Command File Produced by the DDL Compiler
< SCHEMA PRODUCED DATE - TIME : 2/28/93 12:01:41
< SECTION PERSON-RECORD
< Record PERSON-RECORD created on 02/28/93 at 12:01
RESET
SET ALTKEY ( "PN", KEYOFF 0, KEYLEN 31, FILE 0 )
SET ALTKEY ( "EN", KEYOFF 197, KEYLEN 35, FILE 0 )
SET NO ALTCREATE
SET ALTFILE ( 0, folks0 )
SET TYPE E
SET REC 357
SET BLOCK 512
CREATE folks
RESET
SET TYPE K
SET KEYLEN 41
SET REC 41
SET BLOCK 512
SET IBLOCK 512
CREATE folks0