Placeholders, arrays, and nested arrays

You can implement methods in the BOM using COBOL code and placeholders. You use placeholders to keep a place for a COBOL field whose name can vary, or for more complex logic.

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.

When you implement a method, you can use the following placeholders:

For example, if you have the following copybook:

01 COMPANY.
    05 NAME PIC X(20).
    05 SYMBOL PIC X(8).
    05 EMPLOYEE OCCURS 50 TIMES.
        10 EMPNUMBER PIC 9(5).

The imported copybook creates two classes in the BOM, Company and Employee. You can create the following method for the Company class:

public void hasEmployee(Employee emp)

To implement this method, you can use the {} placeholder to refer to the COBOL expression for the method parameter. For example:

For Boolean values, the COBOL code generator creates a Level 88 data item:

02 RETURN-TEMP PIC X.
    88 BOOLVALUE VALUE 'T'.

Here, RETURN-TEMP is a Level 88 data item created for the return value.

The following examples show how the <> and the {} placeholders are used for a boolean type:

For a detailed example of how COBOL methods can use placeholders and arrays, see Example: Using placeholders, arrays and nested arrays.