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:
- 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
- First you will create 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,
type in the tag @type-descriptor.message-buffer.
- Press CTRL-S to save the changes. Note that
new code is automatically generated in the CCIBuffer.java.
- 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.
- In the New Java Method page, click Add.
- Type runMultiSegOutput as the Java method
name. Click Next.
- Click New to define the input type.
- Select COBOL_to_Java mapping. Click Browse.
- Locate the MSOut.cbl COBOL file. Click Open.
- Click Next.
- In the COBOL Importer page, click Show Advanced.
- Select the following options:
Table 1. COBOL Importer Parameter SettingsParameter |
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 |
- Click Query to load the data.
- A list of data structures is shown. Select INPUT-MSG in
the Data structures field.
- Click Next.
- Leave the Save session as Ant script unchecked.
- In the Saving Properties page, the default Class Name is INPUTMSG.
Overwrite the Class Name with InputMsg. Click Finish.
- Next you will create 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.
- In the Java Method page, click Finish.
- 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.
- 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.
- Select 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. Click Browse to find the MSOut.cbl COBOL
copy book.
- Click Next.
- In the COBOL Importer page, click Show Advanced.
- Select the following options:
Table 2. COBOL
Importer Parameter SettingsParameter |
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 |
- Click Query 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,
and select the MultiSegOutput project you created before.
- Click Browse to select the package name: sample.ims.data.
- Change the Java Class Name from OUTPUTSEG1 to OutputSeg1.
- Click Finish.
- Now you will create the OutputSeg2.java class: Select 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. Click Browse to find the MSOut.cbl COBOL
copy book.
- In the COBOL Importer page, click Show Advanced.
- Select the following options:
Table 3. COBOL
Importer Parameter SettingsParameter |
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 |
- Click Query 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 package name: sample.ims.data.
- Change the Java Class Name from OUTPUTSEG2 to OutputSeg2.
- Click Finish.
- Now you will create the OutputSeg3.java class: Select 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. Click Browse to find the MSOut.cbl COBOL
copy book.
- In the COBOL Importer page, click Show Advanced.
- Select the following options:
Table 4. COBOL
Importer Parameter SettingsParameter |
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 Query to load the data.
- A list of data structures is shown. Select OUTPUT-SEG3
in 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 package name: sample.ims.data.
- Change the Java Class Name from OUTPUTSEG3 to OutputSeg3.
- Click Finish.