About copybook templates
- Source definition
- The source definition describes the
copybook members, their corresponding data sets, and how the field definitions are to be arranged in
a template. The simplest form of source definition is a single copybook that contains all the
record layouts required in their correct form. Single copybook source definitions can be referred to
directly and a copybook template is built automatically from them.
Alternatively, you can provide an advanced copybook source definition that describes one or more copybook members, inserted level-01 data items, the range of statements to be included, and how REDEFINES or UNION clauses are to be interpreted in terms of record layouts.
A single copybook source definition can be the entire source of a program or only field definitions.
An advanced copybook source definition must refer to fields definitions for the same language. The source must be members of a partitioned data set.
The copybook template combines the layout information provided by the source definition with additional information supplied by the user pertaining to formatting, reformatting, record selection and data creation, to produce a logical view of the data on which these functions can be performed.
In a copybook template, the field definitions (start position, length and type) are not editable. However, copybook templates allow you to define a number of different formats for use with data sets that contain multiple record types. Records can be identified by type within a data set and each type can be associated with a different format. This allows you to view data with different types at the same time, and to view, edit or copy these records simultaneously. Copybook templates also allow criteria editing by field or by a free format REXX selection expression.
To create a new copybook template, you begin with one or more copybooks containing field definitions that describe the record structure of your data. When you specify the copybook (or copybooks) on a panel, File Manager compiles the descriptions into a template that you can save and reuse with any application data set that has the same record structure.
In a COBOL copybook, each level-01 group item describes a record type in the application data set. The elementary items in the group describe fields in the record type. For example, the following copybook describes the record structure of an application data set that contains two record types, ORDERS and ITEM:
The ORDERS records contain five fields: ORDER-ID, CUSTOMER-ID, ORDER-YEAR, ORDER-MONTH and ORDER-DAY. The ITEM records contain three fields: PRODUCT-ID, QUANTITY and UNIT-COST.
PL/I copybooks are similar to COBOL copybooks, in that the major structures (level-1 names) describe record types and elementary names describe fields:
HLASM copybooks are similar to COBOL copybooks, in that the major structures (DSECT names) describe record types and elementary names describe fields:
For information about coding copybooks, see the IBM COBOL Language Reference, IBM VisualAge PL/I Language Reference , or the HLASM V1R6 Language Reference.
Related topics