< Previous | Next >

Task 2: Configuring the BOM for COBOL copybook generation

Before you can use a Java™ BOM to generate a COBOL copybook, you must make your BOM entries compatible with COBOL code. If they are not compatible, the copybook you generate from the BOM is invalid.

Procedure

To configure the BOM for copybook generation:

  1. In Rule Explorer, right-click the rule project SharingZMiniloan and then select Properties > COBOL Management > COBOL Enabled BOM.
  2. On the COBOL Enabled BOM page, click Add.
  3. In the Select BOM entry dialog, click model , and then click OK.

    The table under Configure type setting for COBOL items shows the proposed mapping between the Java structures in the BOM and the COBOL structures:

    Name Java Type COBOL Picture / Date Format Generated COBOL Item
    xom.Borrower      
    - age int S9(10) age PIC S9(10).
    - creditScore long S9(18) creditScore PIC S9(18).
    - name java.lang.String X(20) name PIC X(20) VALUE SPACE.
    - yearlyIncome long S9(18) yearlyIncome PIC S9(18).
    xom.Loan      
    - amount long S9(18) amount PIC S9(18).
    - approved boolean X approved PIC X.88 BoolValue Value 'T'.
    - effectDate java.util.Date 9(8) [yyyyMMdd] effectDate PIC 9(8).
    - messages java.util.List<java.lang.String> X(20) messages PIC X(20) OCCURS 10 TIMES.
    - yearlyInterestRate short S9(5) yearlyInterestRate PIC S9(5).
    - yearlyRepayment long S9(18) yearlyRepayment PIC S9(18).

    Change the default length for messages from X(20) to X(60).

  4. Click Finish.

    The COBOL enabled BOM is generated.

  5. Back on the COBOL Enabled BOM page, click Manage.
  6. On the Copybook Generation page, specify the name and path of the copybook to be generated.
    1. Click the default copybook name.
    2. Click the ... button next to the default copybook name to display the Select COBOL Copybook page.
    3. Click Browse, and then specify the following copybook name and path: /SharingZMiniloan-execution/copy/HBRLDAT2.cpy in place of the default name and path.
  7. Click OK.
  8. Click Add Top-Level Object on the Copybook Generation page. Add the Java types xom.Borrower and xom.Loan under the Top-Level Object column as the top-level data items in the copybook.
  9. Under the Item Name column, accept the names borrower and loan corresponding to the Java types.

    When you generate the COBOL copybook, these are the names given to the top-level data items.

  10. Click Next to move to a copybook preview.
  11. Click Finish.
  12. Click OK to close the Properties for SharingZMiniloan dialog.
< Previous | Next >