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:
- In Rule Explorer, right-click the rule project SharingZMiniloan and
then select .
- On the COBOL Enabled BOM page, click Add.
- 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).
- Click Finish.
The
COBOL enabled BOM is generated.
- Back on the COBOL Enabled BOM page,
click Manage.
- On the Copybook Generation page, specify
the name and path of the copybook to be generated.
- Click the default copybook name.
- Click the ... button next to the default copybook name to display the
Select COBOL Copybook page.
- Click Browse, and then specify
the following copybook name and path: /SharingZMiniloan-execution/copy/HBRLDAT2.cpy in
place of the default name and path.
- Click OK.
- 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.
- 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.
- Click Next to move to a copybook
preview.
- Click Finish.
- Click OK to close the Properties
for SharingZMiniloan dialog.