+

Search Tips   |   Advanced Search

Invoking the call stub generator from a graphical interface

We can run the COBOL call stub generator as an Ant build from the Rational Application Developer graphical interface.

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.

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, we 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.

  1. Configure Ant builds to run the <csg> task file.

    Specify the <csg> task file on the External Tools Configuration page.

    1. Click Run > External Tools > External Tools Configurations.

    2. 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

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

    4. On the Main tab, select Set an Input handler

    5. 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.

    6. Optional: On the Refresh tab, specify that the Ant build tool build the project or workspace before the tool runs.

    7. Optional: On the Build tab, specify that the Ant build tool refresh the project or workspace after the tool runs.

    8. Click Apply to save the configuration.

  2. Optional: Set the copybook include path for the Rational Application Developer workspace.

    See the topic about setting COBOL importer preferences in the Rational documentation.

  3. Run the call stub generator.

    1. On the Package Explorer view, select a COBOL source file.

      For example, if the COBOL source file is named my_source.cbl, select my_source.cbl in the navigation tree of the Package Explorer.

    2. From the Run menu, select External Tools > 1 CSG Ant 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.


Related tasks

  • Generating COBOL call stubs
  • Create a call stub generator configuration file
  • Invoking the call stub generator from an Ant task

  • Call stub generator CSG.xml file


    Related information:

  • Set COBOL importer preferences