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

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
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 an HP COBOL source program with a COPY statement.
Although a COPY statement can appear anywhere in an 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
Topics:
Simple Copying
Copying With Replacement
Replacing Substrings
Copying Into Debugging Lines
Using Multiple COPY Libraries
Using COPY Libraries Efficiently
Simple Copying
Simple copying means copying text from a COPY library into a source program. This example
uses simple copying to copy the occurrence number in an OCCURS clause into more than one
data description entry, as if it were a constant.
Suppose that the present number of sales offices is 24, but you expect it to change. Put this text
into a COPY library:
?SECTION OFFICES
24
762 Creating and Compiling HP COBOL Source Programs