The J2C dynamic wizard in Rational Application Developer allows
you to create specialized Java classes representing the input and output messages
of an IMS transaction from the corresponding COBOL or C data structures of
the IMS application program. These specialized Java classes are called data
bindings.
Data bindings provide a Java application with methods for populating
the input message with data and for retrieving data from the output message.
In addition, the data bindings perform platform-related functions such as
conversion between the Java (UNICODE) and host (EBCDIC) representations of
the data. To create IMS Java data bindings, complete the following steps:
Note: Ensure
that you are in the J2EE perspective.
- To start the J2C dynamic wizard, from the menu bar, select File
> New > Other > J2C.
- Expand J2C.
- Select CICS/IMS Java Data Binding and click Next.
- On the Data Import page, you need to specify the data import configuration
properties.
- In the Choose mapping drop down list, select COBOL
to Java mapping.
- Click Browse to select the COBOL file
for which you are creating data bindings. For example, browse to rad_install_dir /rad/eclipse/plugins/com.ibm.j2c.cheatsheet.content.6.0.0/samples/IMS/Phonebook/Ex01.cbl.
- Click Next.
- In the Importer wizard, complete the following
steps:
- In the Platform drop down list, select the platform on which
your IMS transactions will run. For example, z/OS.
- In the Code page drop down list, select a different value if
the data of your IMS transaction is in a codepage other than US English (IBM
- 037).
- Click Show Advanced to see the advanced
properties. If you choose the z/OS platform, the values for all
the fields are automatically filled.
- Change the value of TRUNC from STD to BIN. Because
most IMS programs are compiled with the TRUNC(BIN) option, it is recommended
that you change the value of TRUNC from STD to BIN.
- For this example, accept all the other default values listed
in the following table.
Table 1. Options |
Value |
Platform |
z/OS |
Codepage |
IBM-037 |
Floating point format |
IBM 390 Hexadecimal |
External decimal sign |
EBCDIC |
Endian |
Big |
Remote integer endian |
Big |
Quote |
DOUBLE |
Trunc |
BIN |
Nsymbol |
DBCS |
- Click Query to select the data structure
for which you are creating a data binding. The available data structures
in the COBOL file that you specified previously are displayed in the Data
structures pane.
- Select INPUT-MSG, the COBOL data structure
used by the IMS application program to describe the input message for the
IMS transaction.
- Click Next.
- On the Saving Properties page of the Import wizard, complete the
following steps:
- For the Generation Style, use Default.
- For the Java Project Name, click New,
select Java project as the project type, and then click Next.
- In the Create a Java project page, type PhoneBookBindings as
the Java project name, accept all other defaults, and then click Finish.
- In the Saving Properties page, for the Java
Package Name, click New and create a new
Java package named, sample.ims, in the project, PhoneBookBindings.
Then, click Finish.
- Click Finish to save the Import properties.
- In the Project Explorer view, expand Other Projects
> PhoneBookBindings > sample.ims.
- Right-click sample.ims package and select New
> Other > J2C > CICS/IMS Java Data Binding, then Next.
- Repeat steps 4 through 6 to create a data binding for the output
message using OUTPUT-MSG as the data structure.
You now have a project, PhoneBookBindings, containing the data
bindings for the input and output messages of your IMS transaction. These
data bindings can now be used in one or more J2C Java beans or by a Java application
that directly uses the CCI.