< Previous | Next >

Lesson 1.3: Createa Java method

Lesson 1.3 leads you through the creation of a Java method.

Before you begin, you must complete Lesson 1.2. In this lesson you will
  1. First you will create a Java method: In the Project Explorer view, expand the project InOutArray in Dynamic Web Projects.
  2. Right-click on InOutImpl.java in JavaSource, and select Source > Add method to J2C Java bean.
  3. In the Java Method page, click Add.
  4. In the Java method name field, type runInOut for the name of the method.
  5. Click Next.
  6. Next you will create the input data mapping between COBOL and Java: Beside the Input type field of the Java Method page, click New.
  7. In the Data Import page, ensure that the Choose mapping field is COBOL to Java. Click Browse beside the COBOL file field.
  8. Browse to find the file location of the InEqualsOut.cbl file. (You can find a copy in your product installation folder: ..\common\plugins\com.ibm.j2c.cheatsheet.content_6.0.0\Samples\IMS\InOutArray).
  9. Click Open.
  10. Click Next.
  11. In the COBOL Importer page, click Show Advanced.
    1. Select the following options:
      Table 1. COBOL Importer Parameter Settings
      Parameter Value
      Platform Name Z/OS
      Codepage 037
      Floating point format name IBM 390 Hexadecimal
      External decimal sign EBCDIC
      Endian name Big
      Remote integer endian name Big
      Quote name DOUBLE
      Trunc name STD
      Nsymbol name DBCS
    2. Click Query to load the data.
    3. A list of data structures is shown. Select IN-OUT-MSG in the Data structures field.
    4. Click Next.
  12. In the Saving Properties page,
    1. Select Default for Generation Style.
    2. Click Browse beside the Project Name and choose the Web project InOutArray.
    3. In the Package Name field, type sample.ims.data.
    4. In the Class Name field, accept the default INOUTMSG. ClickFinish.
    5. Leave the Save session as Ant script unchecked.
  13. In the Java Method page, select Use input type for output.
  14. Click Finish.
  15. Click Finish to complete the definition of the method.
  16. On the Java Method page, click Finish.
  17. In the Java Methods page, click Finish .

Now you are ready to begin Exercise 1.4: Creating a Java test class to test your application.