Exercise 1.3: Creating a message buffer class

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 message buffer class. In this exercise you will

Creating a message buffer class

  1. 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, add the tag @type-descriptor.message-buffer.

    Add doclet annotation

  6. Press CTRL-S to save the changes. Note that new code is automatically generated in the CCIBuffer.java.

Creating the method to run the IMS transaction and the input message data type

  1. In the Project Explorer view, right click on MSOImpl.java, and select Source > Add method to J2C Java bean.
  2. In the New Java Method page, click Add.
  3. Type runMultiSegOutput as the Java method name. Click Next .
  4. Click the New button to define the Input type.
  5. Select COBOL_to_Java mapping. Click the Browse button.
  6. Locate the MSO.cbl cobol file. Click Open.
  7. Click Next.
  8. In the COBOL Importer page, click on Show Advanced.
  9. In the Saving Properties page, the default java class name is INPUTMSG. Overwrite the Java class Name with InputMsg. Click Finish.

Creating the output message data type

  1. Click Browse to define the output type.
  2. 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.
  3. On the Java Method page , click Finish to complete the definition of the method.
  4. 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.
  5. Click Finish to exit.

Creating the output segment data mappings

To accomplish this step, you need to use a standalone data mapping wizard so that you create only the data mapping files.

Creating OutputSeg1.java

  1. Go to File > New > Other > CICS/IMS Java Data Binding to invoke the Data Binding wizard.
  2. Click Next.
  3. Select COBOL_To_Java in the Choose mapping list. For the Cobol file, browse to find the MSO.cbl Cobol copy book. Click Next.
  4. In the COBOL Importer page, Click Show Advanced.
  5. In the Saving properties wizard, click Browse to select the MultiSegOutput project you created before.
  6. Click Browse to select the the package name: sample.ims.
  7. Change the Java Class Name from OUTPUTSEG1 to OutputSeg1.
  8. Click Finish.

Creating OutputSeg2.java

  1. Go to File > New > Other > J2C > CICS/IMS Data Binding to invoke the Data Binding wizard.
  2. Click Next.
  3. Select COBOL_To_JAVA in the Choose mapping list. For the Cobol File, Browse to find the MSO.cbl Cobol copy book . Click Next
  4. In the COBOL Importer page, Click Show Advanced.
  5. In the Saving properties wizard, click Browse to select the MultiSegOutput project you created before.
  6. Click Browse to select the the package name: sample.ims.
  7. Change the Java Class Name from OUTPUTSEG2 to OutputSeg2.
  8. Click Finish.

Creating OutputSeg3.java

  1. Go to File > New > Other > J2C > CICS/IMS Data Binding to invoke the Data Binding wizard.
  2. Click Next.
  3. Select COBOL_To_Java in the Choose mapping list. For the Cobol File, Browse to find the MSO.cbl Cobol copy book. Click Next
  4. In the COBOL Importer page, click Show Advanced.
  5. In the Saving properties wizard, click Browse to select the MultiSegOutput project you created before.
  6. Click Browse to select the the package name: sample.ims.
  7. Change the Java Class Name from OUTPUTSEG3 to OutputSeg3.
  8. Click Finish.

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

Terms of use | Feedback

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