Exercise 1.3: Creating the Java Method

Before you begin, you must complete Exercise 1.2: Setting up the Web project and Java interface and implementations .

Exercise 1.3 leads you through the creation of a Java method. In this exercise you will

Creating a Java method

  1. In the Snippets view, select J2C. Right click Add Java method to J2C Java bean.
  2. In the Java method name field, type runPhoneBook for the name of the method. Click Next.

Creating the input data mapping between COBOL and Java

In this step, you will import the Ex01.cbl (COBOL) file that is needed to create your applicaion. The Ex01.cbl file is located in <RSDP_installdir>\rad\eclipse\plugins\com.ibm.j2c.cheatsheet.content_6.0.0\Samples\IMS\phonebook, where <RSDP_installdir> is the directory where this product is installed. The COBOL file contains the application program that runs on the IMS server. It has the definition of the structure to be passed to the IMS server via the communications area. This structure represents the customer records being returned from the IMS application program. Before you can work with a file, you must import it from the file system into the workbench.

  1. In the Specify the input/output type of the Java Method page, click New.
  2. In the Data Import page, ensure that the Choose mapping field is COBOL_TO_JAVA. Click Browse beside the Cobol file name field.
  3. Locate the Ex01.cbl file in the file system, and click Open.
  4. Click Next.
  5. In the COBOL Importer page, Click Show Advanced.
  6. In the Saving properties page, select the following values for input type:

Creating the output data mapping between COBOL and Java

  1. In the Java method page, click New next to the Output type field.
  2. In the Data Import page, ensure that the Choose mapping field is COBOL_TO_JAVA.
  3. Click the Browse button besides the Cobol file name field:
  4. Locate the Ex01.cbl file. Click Open.
  5. Once the file is added, Click Next.
  6. In the COBOL Importer page, Click on the Show Advanced.
  7. In the COBOL Importer page, select the following communication data structures:

    Parameter Value
    Platform Name Z/OS
    Floating point format name IBM 390 Hexadecimal
    codepage 037
    External decimal sign EBCDIC
    Endian name Big
    Remote integer endian name Big
    Quote name DOUBLE
    Trunc name STD
    Nsymbol name DBCS


  8. Beside the Data structures text area, click the Query button.
  9. The data structures from the Ex01.cbl file are displayed. Select OUTPUT-MSG. Click Next.
  10. In the Saving properties page, select the following values for output type:
  11. On the Java Method page , click Finish to complete the operation.
  12. In the Binding Details page, ensure that interactionVerb is SYNC_SEND_RECEIVE(1) to indicate that the interaction with IMS involves a send followed by a receive interaction. Click Finish.

Now you are ready to begin Exercise 1.4: Deploying the application.

Terms of use | Feedback

(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.