Invoking the call stub generator from a command line
You can run the COBOL call stub generator from a command line.
Before you begin
Create a Rational® Application Developer project for the code that is generated by the COBOL call stub generator.
Create a call stub generator configuration file. Ensure that the settings for the EclipseHome, WorkSpace, and EclipseProjectName required properties are correct.
Check the PROCEDURE statement for the COBOL source file.
About this task
To run the COBOL call stub generator from a command line, you must run a command that specifies values for the configFile and callStubPackage required parameters. You also can specify values for optional parameters in the command.
The command that runs the COBOL call stub generator must use the following syntax:
java –jar COBOLCallStubGenerator.jar
{input cobol file}
-configFile configuration_file_name
-callStubPackage package_name
[-callStubClass class_name]
[-cobolModule COBOL_module]
[-workSpace path_name]
[-eclipseProjectName project_name]
[-build build_string]
[-mockPackage package_name]
[-mockClass class_name]
[-v | -verbose]
[-? | -h]
Name | Default value | Required or Optional | Description |
---|---|---|---|
configFile | Required | Specifies the name of the call stub generator configuration file. | |
callStubPackage | Required | Specifies the package name, and the file path of generated file, to use for the generated call stub. | |
callStubClass | COBOL PROGRAM-ID | Optional | Specifies the class name to use for the generated call stub. |
cobolModule | COBOL PROGRAM-ID | Optional | Specifies the name of the COBOL module or DLL file that contains the COBOL program. |
workSpace | Optional | Specifies the fully qualified path to the root
directory of the Rational Application Developer or
Eclipse workspace to be used to create the Java™ data binding class. Any value that is specified for workSpace overrides the WorkSpace value in the call stub generator configuration file, which is identified by the configFile value. |
|
eclipseProjectName | Optional | Specifies the name of the project in the Rational Application Developer or Eclipse workspace
that provides the home for the generated Java class. The project must exist before running the call stub generator. Any value that is specified for eclipseProjectName overrides the EclipseProjectName value in the call stub generator configuration file, which is identified by the configFile value. |
|
build | Unknown Build | Optional | Specifies a user-assigned build identifier. |
mockPackage | Optional | Specifies the name of the package for the mock class. | |
mockClass | Optional | Specifies the name of the class to use for the mock test harness. |
Procedure
Results
The command runs the call stub generator. If the command is successful, the call stub generator creates a COBOL call stub Java class.
When running the command, the call stub generator creates a temporary Ant build file, system_temp_directory/CSG.temp.xml, and then runs the file in a headless Eclipse session. The temporary file is deleted after the command runs.
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 IBM® Rational Application Developer for WebSphere® Software, Version 7.5 or later. The call stub generator and the J2C data binding tool run in the headless Eclipse session, which is launched as a separate Java process.
The headless invocation of Eclipse attempts to obtain a workspace lock before running the Ant build file. If a Rational Application Developer session is currently active for the workspace, Eclipse cannot obtain a workspace lock and the command fails.
What to do next
Use the generated COBOL call stub Java class.