Rule Variables
Data Privacy rule variables allow you to store or accumulate values in a work field. Variables are used when temporary work areas are required by disguise rules.
Variables are defined within the rule editor. Each variable definition requires that a name be provided along with the type and scope. The type can be:
- string
- number
- string list
- number list.
The scope of a variable can be either private or public, and the scope determines whether the variable can be shared by other rules.
A private variable is only available to the rule in which it was created. These variables are initialized at the beginning of the execution of the rule. The rule actions control the content of the variable. The value is available across rule actions. When a rule applies to an object multiple times, each rule has its own variable.
A public variable is available to all rules within the project. These variables are initialized at the beginning of the disguise execution. There is also an option on the public variable definition to reset the variable for each record/row read. The rules control the content of the variable. The value is available across rules and rule actions. When a rule applies to an object multiple times, the same public variable is used.
Variables can be used in the same places where other data elements are available (within rule actions and rule logic). Within a rule action, when a list of data elements is displayed, it includes all data elements defined in the project, the private variables for that rule, and all of the public variables. Within rule logic, variables are listed under a separate group in the expression builder. This list includes the private variables defined within the rule and all public variables.
The Variables tab within the rule editor includes all private variables defined in the rule, plus all public variables available in the project. Public variables can be managed from any rule within the project.
The execution order may be important when variables are being used. Rules that use public variables may require that source records be in a specific sequence, or the execution order may need to be used to cause the execution to be in a specific order.
File-AID/Data Solutions Variable Behavior
All records are passed to disguise in the sequence they occur in the file being disguised. Public variables are available between records, even when the records are different types.
File-AID/RDX Variable Behavior
Public variables are available with disguise for an object, but not between objects. Each object is written to a separate split field and disguised separately.
does not produce split files for z/OS files defined with an XREF, so when an XREF is used, public variables are available across record types and segments defined in the XREF just as they are in
.