Generating COBOL call stubs
You can use the COBOL call stub generator to create a Java™ call stub to invoke a COBOL program. You add the call stub to a Java-based batch application.
Before you begin
Read the COBOL container overview topic.
Install the following products, which are required to use the COBOL call stub generator:
- IBM® Rational® Application Developer for WebSphere® Software, Version 7.5 or later, which provides the J2EE Connector (J2C) tools
- Java Runtime Environment (JRE), Version 1.6.0 or later
To verify that the Java EE Connector (J2C) tools are enabled, start Rational Application Developer, select the Java EE perspective, and select . If the J2C wizard is available, then you can create a J2C project and the J2C tools are enabled.
If the Rational Application Developer installation does not have the Java EE Connector (J2C) tools, use Installation Manager to modify your Rational Application Developer installation and install the J2C tools:
- Start Installation Manager.
- On the Modify Packages page, select .
- Complete the installation of the J2C tools.
About this task
You can run the COBOL call stub generator from a command line, an Ant task, or the graphical interface of the Rational Application Developer product.
The COBOL call stub generator performs the following steps:
- Parses the COBOL source program.
- Generates the Java code for the call stub to invoke the COBOL program.
- Generates the Java code for the data bindings for the parameter inputs and return value that are used by the COBOL program. The source program is assumed to be a valid COBOL program that has been parsed and compiled by a COBOL compiler.
The Java data binding classes for the COBOL parameters and return value are generated by the J2C data binding tool, which is part of the Java EE Connector tools of the Rational Application Developer product. When you run the COBOL call stub generator from a command line, the call stub generator and the data binding tool run in a headless Eclipse session. The headless Eclipse session is launched as a separate Java process. When you run the COBOL call stub generator from the graphical interface, the call stub generator and the data binding tool run within the active Rational Application Developer session.
Procedure
Results
If the call stub generator invocation is successful, the call stub generator creates a Java call stub to invoke a COBOL program.
- workspace_path/.metadata/.log
- The log identifies whether problems with the Eclipse-based tools, such as the headless invocation did not start, caused the error.
- user_home/.eclipse/ibm.software.delivery.platform_7.5.0/configuration
- Each headless invocation might create log files in the configuration directory. If the log files exist, they might provide troubleshooting information on the error.
What to do next
Use the generated Java call stub to invoke a COBOL program.