You can run the COBOL call stub generator as an Ant build
from the Rational® Application Developer graphical
interface.
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 the Rational Application Developer graphical interface,
specify the <csg> task file to use and run the task file in the
same Java runtime environment
(JRE) as the workspace.
For the <csg> task file, you can
use the sample Ant build file, CSG.xml, that
is available with the call stub generator of the IBM® Rational Application Developer for WebSphere® Software product.
For CSG.xml input property descriptions, see
the topic about the call stub generator CSG.xml file.
For descriptions of the <csg> attributes and elements, see the
topic about invoking the call stub generator from an Ant task.
The <csg>
task and the data binder Ant build file have runtime dependencies
on some Eclipse classes, including the Java EE Connector (J2C) tools.
When you run the <csg> task within Rational Application Developer as an Ant build, the
product obtains all the prerequisites.
Procedure
- Configure Ant builds to run the <csg> task file.
Specify the <csg> task file on the External
Tools Configuration page.
- Click .
- For Buildfile on the Main tab,
specify the full path name for the <csg> task file.
For
example, to use the CSG.xml Ant build file, specify:
product_installation_root/CobolCallStubGenerator.V1.2/CSG.xml
- For Arguments on the Main tab,
specify values for the required CSG.xml input
properties.
For example, for the CSG.xml Ant
build file, specify values such as the following for required properties:
-DcobolSource=${resource_loc}
-DworkSpace=${workspace_loc}
-DeclipseProjectName=${project_name}
-DcallStubPackage=${string_prompt:callStubPackage}
For property descriptions, including descriptions of the
built-in variables such as resource_loc, see the
topic about the call stub generator CSG.xml file.
- On the Main tab, select Set
an Input handler
- On the JRE tab, select Run
in the same JRE as the workspace.
This setting
ensures that the JRE contains the required Java EE Connector (J2C)
tools.
- Optional: On the Refresh tab,
specify that the Ant build tool build the project or workspace before
the tool runs.
- Optional: On the Build tab,
specify that the Ant build tool refresh the project or workspace after
the tool runs.
- Click Apply to save the configuration.
- Optional: Set the copybook include path for
the Rational Application Developer workspace.
See the topic about setting COBOL importer preferences in
the Rational documentation.
- Run the call stub generator.
- On the Package Explorer view, select a COBOL source
file.
For example, if your COBOL source file is named my_source.cbl,
select my_source.cbl in the navigation tree of
the Package Explorer.
- From the Run menu, select to run the call stub generator.
The
first time that you run the tool, the call stub generator Ant file
might not show up as an option under the External Tools menu.
To fix this problem, run the tool from the External Tools
Configuration page.
Results
The call stub generator is run and the output is printed
to the Rational Application Developer console.
The call stub generator creates a COBOL call stub Java class.
What to do next
Use the generated COBOL call stub Java class.