Creating mapped methods

You use mapped methods to implement more complex COBOL bodies, using COBOL paragraphs.

About this task

Note: The COBOL code generation feature is deprecated in V8.5.1. 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. For more information, see Migrating from Rules for COBOL.

You create a mapped method by creating a method in Rule Designer and then implementing the COBOL code for the method.

Procedure

To create a mapped method:

  1. In the Rule Explorer, open the BOM editor for the required class.
  2. On the Class page, in the Members section, click New.
  3. In the New Member dialog, on the Member page, make the following entries:
    1. Select the Method radio button.
    2. In the Name field, type a name for the method.
    3. Select the required Java™ Type for the method.
  4. Click Add, and in the Method Argument dialog, make the following entries.
    1. In the Name field, type a name for the parameter.
    2. In the Type field, type or select the required argument type.
  5. Click OK to close the Method Argument dialog.
  6. Click Finish to close the New Member dialog.
  7. In the BOM Editor, in the Member verbalization section, type a navigation phrase in the Template field.
  8. Save your work.

    The Mapped Method table displays the data type definitions for the method.

    Create mapped method

    Each line of the mapped method is stored as a BOM property of the BOM class. You can change the default definitions at project level and make certain changes at method level, using the COBOL Data Type Editor. For information about changing data definitions, see Changing data definitions for mapped method parameters.

  9. To implement the method in COBOL code:
    1. In the Rule Explorer, double-click the new method.
    2. On the Member tab, scroll down to the COBOL method area and then click Create a mapped method.
    3. In the Body section, use the COBOL Method Body Editor to write a COBOL paragraph to implement the method.
  10. Save your work.

Results

The method will be included in the generated COBOL code, and the generated code can exchange data with the COBOL calling program.