COBOL code generation reports
You can view COBOL code generation error reports using Rule Designer, Decision Center, or Ant.
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.
To make sure that the correct COBOL code is generated from the business rules and methods that you have authored, the COBOL code generator reports any BAL features or ruleflow functions that it does not support.
If errors occur during code generation, the COBOL code generator generates an error message stating what the error is, where in the generated code it occurs, and the artifact type to which it relates. You must resolve all errors before you can compile the generated COBOL code successfully.
You can view errors for code generated using Rule Designer, Decision Center, or an Ant script. If you generate the COBOL code in Rule Designer, any errors are displayed in the COBOL Code Generation Problems view. For Decision Center or Ant, the COBOL code generator creates an error report file.
The following table lists a set of common errors caused by action rule, decision table, or decision tree syntax errors. For information on BAL features that you can and cannot use, see Rule authoring for COBOL compatibility.
For ruleflow limitations, see Ruleflows and COBOL code generation.
| Error message | Cause | Resolution |
|---|---|---|
| COBOL supports only simple Date type | You have used the universal Date type or the Time type. | Replace with the simple date type. |
| Unsupported construct ‘new’ | Several things can cause this error. For example:
set var1 to a number in {1, 2, 3}; |
Replace with a BAL construct that the COBOL code generator supports. See Rule authoring for COBOL compatibility. |
| Type cast error | You have tried to cast a type that the COBOL code generator does not support, such as a character. You cannot use the Char type in the BAL. See Rule authoring for COBOL compatibility. | Change the type to one that the COBOL code generator supports, such as String. |
| Undefined or unsupported method | You can get this error if you have: a) Used an unsupported BAL operator or construct, such as a Universal Date operator or Print construct b) Defined a method in the BOM but not implemented it in COBOL |
If (a) remove the Time operator or change the operator to a type that the COBOL code generator supports. If (b) implement the corresponding mapped or macro method. |
| Undefined BOM class or attribute | No COBOL definition to match a BOM class or a class attribute. Classes and their attributes must be derived from the copybook. You cannot add them manually to the BOM. | Remove any classes or class attributes that have been added manually to the BOM and define them in the copybook instead. |
| Sign <> cannot be used in COBOL macro method | You have used the <> placeholder in a macro method. You can use this placeholder in mapped methods, but not in macro methods. For macro methods you must use {}. | Change the placeholder type to {}. |
| Sign <> cannot be used for non-table placeholder | You have tried to define a <> placeholder for a non-table data item. Non-table classes are derived from the copybook, so they are already defined and no COBOL item is generated in the COBOL code. You can use the <> placeholder to refer only to a COBOL-generated data item. | Change the placeholder type to {}. |
| No enumerator for object binding | The COBOL code generator does not support object binding from Working Memory. | Make sure that you refer to the object from a ruleset parameter. |
| Unsupported variable set type | You have used an unsupported variable type for the variable set. For variable sets, the COBOL code generator supports Java™ primitive types, plus the String and Date types. See Defining variable sets and ruleset variables. | Change the variable set type. |