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
- Create a message buffer class
- Edit the message buffer class using doclet annotations
- Create the input and output binding operations
- Create the output segment data mappings
Creating a message buffer class
- Expand the MultiSegOutput project, expand Java Resources, and expand JavaSource.
- Right click on the sample.ims package, and select New > Class to launch the New Class wizard.
- Type CCIBuffer as the name of the class. Accept all default settings.
- Click Finish. The CCIBuffer class opens in the Java editor.
- In the comment section of the CCIBuffer class, add the tag @type-descriptor.message-buffer.
- 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
- In the Project Explorer view, right click on MSOImpl.java, and select Source > Add method to J2C Java bean.
- In the New Java Method page, click Add.
- Type runMultiSegOutput as the Java method name. Click Next .
- Click the New button to define the Input type.
- Select COBOL_to_Java mapping. Click the Browse button.
- Locate the MSO.cbl cobol file. Click Open.
- Click Next.
- In the COBOL Importer page, click on Show Advanced.
- Select the following options:
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 |
- Click the Query button to load the data.
- A list of data structures is shown. Select INPUT-MSG in the Data structures field. Click Next .
- 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
- Click Browse to define the output type.
- 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.
- On the Java Method page , click Finish to complete the definition of the method.
- 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.
- 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
- Go to File > New > Other > CICS/IMS Java Data Binding to invoke the Data Binding wizard.
- Click Next.
- Select COBOL_To_Java in the Choose mapping list. For the Cobol file, browse to find the MSO.cbl Cobol copy book. Click
Next.
- In the COBOL Importer page, Click Show Advanced.
- Select the following options:
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 |
- Click the Query button to load the data.
- A list of data structures is shown. Select OUTPUT-SEG1 in the Data structures field. Click Next .
- In the Saving properties wizard, click Browse to select the MultiSegOutput project you created before.
- Click Browse to select the the package name: sample.ims.
- Change the Java Class Name from OUTPUTSEG1 to OutputSeg1.
- Click Finish.
Creating OutputSeg2.java
- Go to File > New > Other > J2C > CICS/IMS Data Binding to invoke the Data Binding wizard.
- Click Next.
- Select COBOL_To_JAVA in the Choose mapping list. For the Cobol File, Browse to find the MSO.cbl Cobol copy book . Click Next
- In the COBOL Importer page, Click Show Advanced.
- Select the following options:
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 |
- Click the Query button to load the data.
- A list of data structures is shown. Select OUTPUT-SEG2 in the Data structures field. Click Next .
- In the Saving properties wizard, click Browse to select the MultiSegOutput project you created before.
- Click Browse to select the the package name: sample.ims.
- Change the Java Class Name from OUTPUTSEG2 to OutputSeg2.
- Click Finish.
Creating OutputSeg3.java
- Go to File > New > Other > J2C > CICS/IMS Data Binding to invoke the Data Binding wizard.
- Click Next.
- Select COBOL_To_Java in the Choose mapping list. For the Cobol File, Browse to find the MSO.cbl Cobol copy book. Click Next
- In the COBOL Importer page, click Show Advanced.
- Select the following options:
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 |
- Click the Query button to load the data.
- A list of data structures is shown. Select OUTPUT-SEG3 in the Data structures field. Click Next .
- In the Saving properties wizard, click Browse to select the MultiSegOutput project you created before.
- Click Browse to select the the package name: sample.ims.
- Change the Java Class Name from OUTPUTSEG3 to OutputSeg3.
- Click Finish.
Now you are ready to begin Exercise 1.4: Creating a Java proxy class to test your application.