+

Search Tips   |   Advanced Search

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.

  1. Install the COBOL call stub generator.

    The COBOL call stub generator tool compressed file can be found in the <was-home>/lib directory of the batch installation. Extract the file anywhere on the workstation.

    Supported configurations: The COBOL call stub generator tool requires Java 1.6.

  2. Create a COBOL call stub generator properties file for your system. Read the Creating a call stub generator configuration file topic for more information.

  3. 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   Sample

    The 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 specified 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/sample

    and 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 concepts

  • COBOL container overview


    Related tasks

  • Develop COBOL container batch applications
  • Compiling COBOL call stub Java classes
  • Dynamically updating a COBOL module
  • Generating 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