Generating the COBOL copybook

After you configure the BOM to COBOL mapping, you specify the top-level objects for the COBOL copybook generation.

About this task

Important:

If you intend to execute your rules by using a generated COBOL program, you must implement the BOM methods in COBOL before you generate the COBOL code. See Implementing BOM methods for COBOL code generation.

Procedure

  1. On the COBOL Enabled BOM page, click Manage next to the COBOL copybook setting field.

    This field is used to create a COBOL copybook that is based on the BOM to COBOL mapping defined in the COBOL BOM setting field.

    On the Copybook Generation pane, you see a copybook with its top-level data items that correspond to the ruleset parameter values by default.

  2. Optional: On the Copybook Generation pane, you can do the following actions:
    • Add a copybook:
      1. Click Add Copybook.
      2. Specify the name and path of the copybook to be generated.
    • Add a top-level object:
      1. Select the copybook for which you want to add a top-level object.
      2. Click Add Top Level Object and then select the top-level object type.

    You can add, remove, reorder (Up and Down buttons) the top-level objects of the copybook. You can change the default item names. You can also add another copybook and specify its top-level objects.

  3. Click Next. A preview of the copybook to be generated is displayed. You must fix errors in the preview page before you continue.

    If there are structures in the BOM that are not compatible with COBOL code or if some COBOL BOM mappings are not enabled, you see errors in the preview page. These errors prevent the generation of the copybook. Hover over the errors to find out details about them.

    To fix the ’BOM class without valid COBOL mapping’ errors:
    1. Enable the BOM to COBOL mapping for related BOM entries.
    2. Manage the copybook generation based on the enabled BOM entries.
    To fix the incompatible BOM structure errors:
    1. Update the BOM with COBOL compatible Java™ structures.
    2. Update the BOM by using the COBOL BOM setting wizard. Select the BOM and then click Update.

    If you have no errors, the Configure type setting for COBOL items table lists each Java object and shows the default mapping of each attribute with its corresponding COBOL data item.

    The generated copybook is shown in the COBOL copybook setting field on the COBOL Enabled BOM pane.

  4. Click OK.