Creating the Java data binding class
The CICS/IMS Java Data Binding wizard enables you to create a class or set of classes that map to COBOL, to C, or to PL/I data structures:
| Select File Æ New Æ Other Æ J2C Æ CICS/IMS Java Data Binding, and click Next.
|
| In the Data Import dialog, for Choose mapping, select COBOL to Java, then click Browse and locate the file taderc99.cbl in the directory:
|
<RAD_Install_SDPShared>\plugins\com.ibm.j2c.cheatsheet.content_7.0.1.v20080
710-1450\Samples\CICS\taderc99
The COBOL DFHCOMMAREA structure in taderc99 is shown in Example | 0-1.
Example 20-1 DFHCOMMAREA of COBOL program
01 DFHCOMMAREA.
02 CustomerNumber PIC X(5).
02 FirstName PIC A(15).
02 LastName PIC A(25).
02 Street PIC X(20).
02 City PIC A(20).
02 Country PIC A(10).
02 Phone PIC X(15).
02 PostalCode PIC X(7).
| Click Next.
|
| In the Importer dialog, you can set values for the platform, code page and other properties. For Data Structures the default DFHCOMMAREA is preselected. Click Next.
|
| In the Saving Properties dialog, enter:
|
Project Name: Taderc99 (click New and create a new Java project)
|
Package Name: sample.cics.data
|
ClassName: Change the default DFHCOMMAREA to CustomerInfo.
|
| Click Finish.
|
Review the generated Java file CustomerInfo class. Notice that it implements javax.resource.cci.Record and that it exposes getters and setters for all the fields of DFHCOMMAREA (for example, getFirstName and setFirstName).