Import Copybooks

The host transaction that you use to build your client operation is populated by the data items contained in a COBOL copybook.

You can import or redefine a copybook to update or replace a host transaction data structure.

When you import a new copybook and associate it with a host transaction, the previously associated copybook is over-written. The name and data variables of the host transaction and client operation mappings are replaced with the data from the new data structure. However, the original copybook, host transaction, and client operation are available until you save the project.

To import a copybook

  1. After you declare a new host transaction, the Import wizard displays.

    If you are using an existing host transaction, from the File menu, choose Import and then select Copybooks to Replace Existing Data Structure, then select the host transaction you want to associate with the imported copybook.

  2. Click Next.
    If you are using
    Then do this
    A new host transaction Click Add to browse to a copybook file.
    An existing host transaction The previous copybook file is selected. You can click Delete to remove this file or click Add to browse to a new copybook file.
  3. Click UP or DOWN to rearrange the copybooks and define the data structure.

    The order in which copybooks are placed must match the order expected by the host program.

  4. Click Finish.

The copybook is displayed in the Copybook Editor. If necessary you can edit the copybook in the editor. A full range of editing capabilities are available to you.

If you import more than one copybook, the copybooks are concatenated in the sequence in which they were chosen in the Import dialog box. If you imported one copybook, a copy of the selected copybook is displayed in the editor. See Edit Copybooks for more information.

Verify that the mapping between elements in your client operation and data items in your host transaction is accurate. Although the map is updated when the copybook is imported, it is important to make sure that the map is correct before you save your project.

Re-importing a copybook

You can re-import copybooks. When re-importing:

Manually creating a copybook

You can create a copybook by copying and pasting from a COBOL program that does not contain a simple copybook to import, by importing without selecting a specific copybook. Click Finish.

Related Topics
Bullet Edit Copybooks
Bullet About COBOL Copybooks
Bullet How to Handle COBOL Data Division Entries
Bullet Declare a Host Transaction