< Previous

Lesson 1.3: Create a message buffer class

Lesson 1.3 leads you through the creation of a message buffer class.

Before you begin, you must complete Lesson 1.2: Setting up the Web project and Java™ Interface and Implementations. In this lesson you will:
  1. First you will create a message buffer class: Expand the MultiSegOutput project, expand Java Resources, and expand JavaSource.
  2. Right click on the sample.ims package, and select New > Class to launch the New Class wizard.
  3. Type CCIBuffer as the name of the class. Accept all default settings.
  4. Click Finish. The CCIBuffer class opens in the Java editor.
  5. In the comment section of the CCIBuffer class, type in the tag @type-descriptor.message-buffer.
  6. Press CTRL-S to save the changes. Note that new code is automatically generated in the CCIBuffer.java.
  7. Next you will create a method to run the IMS™ transaction and the input message data type: In the Project Explorer view, right click on MSOImpl.java, and select Source > Add method to J2C Java bean.
  8. In the New Java Method page, click Add.
  9. Type runMultiSegOutput as the Java method name. Click Next.
  10. Click New to define the input type.
  11. Select COBOL_to_Java mapping. Click Browse.
  12. Locate the MSOut.cbl COBOL file. Click Open.
  13. Click Next.
  14. 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 IBM-037
      Floating point format name IBM® 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 INPUT-MSG in the Data structures field.
    4. Click Next.
    5. Leave the Save session as Ant script unchecked.
  15. In the Saving Properties page, the default Class Name is INPUTMSG. Overwrite the Class Name with InputMsg. Click Finish.
  16. Next you will create the output message data type: Click Browse to define the output type.
  17. Type CC in the Select a data type field, and CCIBuffer will appear in the Matching types field. Select CCIBuffer as the output type. Click Finish.
  18. In the Java Method page, click Finish.
  19. In the Java Methods page, ensure that the interactionVerb is set to SYNC_SEND_RECEIVE (1) to indicate that the interaction with IMS involves a send followed by a receive interaction.
  20. Click Finish.
  21. Next you will create the output segment data mappings. First you will create the OutputSeg1.java class: To accomplish this step, you need to use a standalone data mapping wizard so that you create only the data mapping files.
  22. Select File > New > Other > CICS/IMS Java Data Binding to invoke the Data Binding wizard.
  23. Click Next.
  24. Select COBOL_To_Java in the Choose mapping list. Click Browse to find the MSOut.cbl COBOL copy book.
  25. Click Next.
  26. In the COBOL Importer page, click Show Advanced.
    1. Select the following options:
      Table 2. COBOL Importer Parameter Settings
      Parameter Value
      Platform Name Z/OS
      Codepage IBM-037
      Floating point format name IBM 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 OUTPUT-SEG1 in the Data structures field.
    4. Click Next.
  27. In the Saving properties wizard, click Browse, and select the MultiSegOutput project you created before.
  28. Click Browse to select the package name: sample.ims.data.
  29. Change the Java Class Name from OUTPUTSEG1 to OutputSeg1.
  30. Click Finish.
  31. Now you will create the OutputSeg2.java class: Select File > New > Other > CICS/IMS Java Data Binding to invoke the Data Binding wizard.
  32. Click Next.
  33. Select COBOL_To_Java in the Choose mapping list. Click Browse to find the MSOut.cbl COBOL copy book.
  34. In the COBOL Importer page, click Show Advanced.
    1. Select the following options:
      Table 3. COBOL Importer Parameter Settings
      Parameter Value
      Platform Name Z/OS
      Codepage IBM-037
      Floating point format name IBM 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 OUTPUT-SEG2 in the Data structures field.
    4. Click Next.
  35. In the Saving properties wizard, click Browse to select the MultiSegOutput project you created before.
  36. Click Browse to select the package name: sample.ims.data.
  37. Change the Java Class Name from OUTPUTSEG2 to OutputSeg2.
  38. Click Finish.
  39. Now you will create the OutputSeg3.java class: Select File > New > Other > CICS/IMS Java Data Binding to invoke the Data Binding wizard.
  40. Click Next.
  41. Select COBOL_To_Java in the Choose mapping list. Click Browse to find the MSOut.cbl COBOL copy book.
  42. In the COBOL Importer page, click Show Advanced.
    1. Select the following options:
      Table 4. 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 OUTPUT-SEG3 in in the Data structures field.
    4. Click Next.
  43. In the Saving properties wizard, click Browse to select the MultiSegOutput project you created before.
  44. Click Browse to select the package name: sample.ims.data.
  45. Change the Java Class Name from OUTPUTSEG3 to OutputSeg3.
  46. Click Finish.
< Previous