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.
WARNING! 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
- After declaring 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.
- 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.
- 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.
- 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:
- Follow the import copybook instructions for an existing Host Transaction.
NOTE: When you re-import, you can browse to a particular copybook file, including previously edited copybooks. However, the location of the original copybook is shown, not the location of the copybooks saved in internal project directories.
- The Host Transaction and Client Operation are updated based on the contents of the new copybook.
- After re-importing, you can start editing immediately. Errors are indicated in the Copybook Source Editor.
See Editing Copybooks with Syntax Errors
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.