Generating COBOL code in Rule Designer

You generate COBOL code in Rule Designer using the Generate COBOL Code wizard, and then upload the generated program to z/OS®.

About this task

Deprecated feature:

Deprecation icon The COBOL code generation feature is deprecated in V8.5. This feature will be removed in a future release of the product. Use the COBOL Generation Project Migration wizard to migrate your Rules for COBOL project to a zRule Execution Server for z/OS compatible rule project. See Deprecated features for migration details.

If you want to generate the COBOL code for a CICS® program, you must first define your CICS channel and container parameters. See Configuring code generation for a CICS program.

Procedure

To generate COBOL code in Rule Designer:

  1. In the Rule Explorer, right-click your rule project and then click COBOL Code Generation > Generate COBOL Code.
  2. On the Generate COBOL Code page, enter the following details:
    1. In the Program ID field, type an identifier for the COBOL program.

      Keep the length of the program ID a maximum of 8 characters, so that the code conforms to z/OS standards.

    2. Select the Output file you want to use to store the generated code.
      • If the output file resides in your workspace, click Workspace and then search your workspace to find the file.

      • If it resides in your file system, click File System and then navigate to the relevant directory.

  3. If you want to use a ruleset extractor, click the Ruleset extractor check box and then select the ruleset extractor you want to use.

    A ruleset extractor provides a means of filtering the rules in a project to include only those rules that you want to execute. The list of ruleset extractor options comes from predefined ruleset extractors in Rule Designer. For information about using ruleset extractors, see Configuring rule task execution.

  4. To generate the code for a CICS program, enter the following details, otherwise skip this step.

    The following figure shows the CICS Option selected.

    CICS options for code generation
    Note:

    To use the CICS Option, you must already have defined your CICS channel and container parameters. See Configuring code generation for a CICS program.

    1. Select the CICS Option check box.
    2. In the CICS Wrapper Program ID field, type an identifier for the CICS wrapper program.

      Keep the length of the program ID to a maximum of 8 characters.

    3. Select the CICS Wrapper Output file you want to use to store the generated CICS code.
      • If the output file resides in your workspace, click Workspace and then search your workspace to find the file.

      • If it resides in your file system, click File System and then navigate to the relevant directory.

  5. Click Finish.
  6. When you see the code generation successful prompt, click OK to close the message dialog.

Results

You can now upload the generated COBOL code to z/OS and integrate it with the COBOL calling program.

If you selected the CICS Option, the necessary channels and containers are created in a CICS wrapper program that calls the COBOL program for the business rules. You must now update the CICS calling program so that it calls the wrapper program. See Calling a CICS wrapper program to integrate the code.

To view examples of generated COBOL code, see Sample generated COBOL code and Sample CICS wrapper program.