Lesson 1.3 leads you through the creation of a Java method.
In this lesson you will
- Create a Java method
- Create the input and output data mapping between COBOL and Java
- In the Enterprise Explorer view, expand the project InOutArray in
Dynamic Web Projects.
- Select ; right-click on InOutImpl.java,
and select Source > Add/Edit J2C Java bean method.
- In the Java Method
page, click Add.
- In the Name field, type runInOut for
the name of the method.
- Beside the Input type field, click New.
- In the Data Import page, ensure that the Choose
mapping field is COBOL to Java.
Click Browse beside the COBOL file field.
- Browse to find the file location of the InEqualsOut.cbl
file. (You can find a copy in your product installation folder: <installdir>\IBM/SDPShared/plugins/com.ibm.j2c.cheatsheet.content/Samples/\IMS/InOutArray).
- Click Open, and click Next.
- In the COBOL Importer page, click Show Advanced.
- 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 |
- Click Query to load the data.
- A list of data structures is shown. Select IN-OUT-MSG in
the Data structures field, and click Next.
- In the Saving Properties page,
- Select Default for Generation
Style.
- Click Browse beside the Project
Name and choose the Web project InOutArray.
- In the Package Name field, type sample.ims.data.
- In the Class Name field, accept
the default INOUTMSG. ClickFinish.
- Leave the Save session as Ant script cleared.
- In the Java Method
page, select Use input type for output.
- Click Finish.
- Click Finish to complete the definition
of the method.