COBOL rule validation

COBOL management provides an automatic value checker that validates rules against the definitions of the terms in the BOM.

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.

You set the constraints in the COBOL copybook.

When a mapped BOM attribute is assigned or compared with a constant value, the value checker checks if the constant value conforms to the restrictions of the COBOL item. For example, it might check the length of a string, or whether or not an integer can be a negative number.

Note:

The value checker checks the length of String literals, but not the length of String variables.

In the following example, the COBOL copybook has two string data items, FirstName and LastName, with a maximum length of 20 characters. Salary is an integer with a maximum length of 10 characters.

01 Employee.
    05 FirstName PIC X(20).
    05 LastName  PIC X(20).
    05 Salary    PIC 9(10).

The following rule assigns a constant value to the FirstName and the Salary attributes:

   set the first name of ‘the employee’ to "012345678901234567890"
   set the salary of ‘the employee’ to 12345678901

This rule violates the constraints of the Picture clause defined in the copybook because each string is too long. In this case, the value checker reports the following errors:

Errors (2 items)
Value (number) 12345678901 is incorrect: Does not match 9(10)
Value (string) 012345678901234567890 is incorrect: Does not match X(20)

Both errors are caused by an overflow of the size limitation of the corresponding COBOL data items.