Defining variable sets and ruleset variables
For COBOL code generation, you can use only certain types for ruleset variables.
About this task
Ruleset variables are data internal to the ruleset that can be referenced by any part of the rule project. For COBOL code generation, you can use only the following types for ruleset variables.
Java™ primitive types
String
Date
Class type ruleset variables are not supported.
You group ruleset variables into variable sets. Before you can use a ruleset variable, you must define a variable set for it. When you generate the COBOL code for rule execution, all the items defined in a variable set are declared in the WORKING-STORAGE SECTION, so you do not have to define them in the original or a separate copybook.
Procedure
To define a variable set and ruleset variable:
Results
You can now use the new variable in your rules.
The following example demonstrates using a variable named local in the variable set validation.LocationCheck.
if the location of 'the borrower' is not local and the location of 'the borrower' is one of { "C1" , "C2" , "C3" } then add message "These rules may not be effected in " + the location of 'the borrower' ;