Create a COBOL call stub Java class
To call a COBOL module from a Java batch plain old Java object (POJO) in the batch environment, first create a COBOL call stub Java class.
Tasks
- Install the COBOL call stub generator.
The COBOL call stub generator tool compressed file can be found in the <was-home>/lib directory of our batch installation. Extract the file anywhere on your workstation.
The COBOL call stub generator tool requires Java 1.6.
- Create a COBOL call stub generator properties file for the system. Read the Creating a call stub generator configuration file topic for more information.
- Use the COBOL call stub generator tool to create a COBOL call stub Java class; for example:
$ cd COBOLCallStubGenerator $ java -jar lib/COBOLCallStubGenerator.jar testcases/Sample01.cbl \ -configFile csg.properties -callStubPackage com.ibm.ws.batch.ilc.sample \ -callStubClass SampleThe COBOL call stub generator tool can also be invoked from within Rational Application Developer. Read the Generating COBOL call stubs topic for more information about the tool.
The generated code is written to the src directory of the Rational Application Developer workspace and project directory we specify on the WorkSpace and EclipseProjectName properties in the csg.properties file, which is found in the COBOL call stub generator install directory (/COBOLCallStubGenerator).
The COBOL call stub generator tool then writes Sample.java to the following directory:
${WorkSpace}/${EclipseProjectName}/src/com/ibm/ws/batch/ilc/sampleand any data binding classes for the linkage section variable used on the PROCEDURE statement to the following directory:${WorkSpace}/${EclipseProjectName}/src/com/ibm/ws/batch/ilc/sample/parameters
Related:
COBOL container overview Developing COBOL container batch applications Compiling COBOL call stub Java classes Dynamically updating a COBOL module Generate COBOL call stubs Create a call stub generator configuration file COBOL call stub Java class usage example COBOL RETURNING, RETURN-CODE, getReturnValue, and getReturnCode parameters