Creating IMS Java data bindings

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.
  1. To start the J2C dynamic wizard, from the menu bar, select File > New > Other > J2C.
  2. Expand J2C.
  3. Select CICS/IMS Java Data Binding and click Next.
  4. On the Data Import page, you need to specify the data import configuration properties.
    1. In the Choose mapping drop down list, select COBOL to Java mapping.
    2. 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.
    3. Click Next.
  5. In the Importer wizard, complete the following steps:
    1. In the Platform drop down list, select the platform on which your IMS transactions will run. For example, z/OS.
    2. 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).
    3. Click Show Advanced to see the advanced properties. If you choose the z/OS platform, the values for all the fields are automatically filled.
    4. 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.
    5. 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
    6. 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.
    7. Select INPUT-MSG, the COBOL data structure used by the IMS application program to describe the input message for the IMS transaction.
    8. Click Next.
  6. On the Saving Properties page of the Import wizard, complete the following steps:
    1. For the Generation Style, use Default.
    2. For the Java Project Name, click New, select Java project as the project type, and then click Next.
    3. In the Create a Java project page, type PhoneBookBindings as the Java project name, accept all other defaults, and then click Finish.
    4. 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.
  7. Click Finish to save the Import properties.
  8. In the Project Explorer view, expand Other Projects > PhoneBookBindings > sample.ims.
  9. Right-click sample.ims package and select New > Other > J2C > CICS/IMS Java Data Binding, then Next.
  10. 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.
Related tasks
Creating a J2C Java bean
Exposing InteractionSpec and ConnectionSpec properties for input as data
Exposing InteractionSpec output properties as data
Creating a web page, web service, or EJB from a J2C Java bean
Using IMS data bindings in a CCI application
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.