0 / 0

Rule set extensions in the pattern-action file

Last updated: Mar 12, 2025
Rule set extensions in the pattern-action file

You can enable rule set extensions by updating the pattern-action file with references to rule groups. The pattern-action file can contain only one reference to each rule group.

You can use the following syntax:
PROCESS_RC Rule_Group_Name RC_Return [Rule_ID]
Argument Description
Rule_Group_Name The name of the rule group. The name can contain only alphanumeric and underscore characters, and must begin with an alphanumeric character.
Rule_ID The name of a variable. When the action is executed, the name of the rule that applied to the current record is written to the variable. If no rule applied to the record, the variable is empty.

You can add actions to the pattern-action language that use this variable. For example, you can add an action that adds the rule ID to an output column for reporting purposes.

This argument is optional.

When you add a reference to a rule group, choose a location in the pattern-action file based on when you want the actions to be executed. For example, to apply the rules in a rule group before any other processing, add a reference at the beginning of the first subroutine that is called.

Return code values

When you reference a rule group, you can add actions that are based on the value of the return code for each input record. The value of the return code depends on whether any rules in the rule group apply to a particular input record.

Value Description
0 No rules in the rule group apply to the input record.
1 A rule in the rule group applies to the input record.
2 A rule in the rule group applies to the input record, but records are set to pass through the rule. As a result, the record will not be changed by the rule.

Examples

PROCESS_RC Input_Overrides RC_Return 
[ RC_Return = "1" ] ; A rule in the rule group applies to the input record: CALL Post_Process SUBROUTINE then EXIT
COPY "CI" {UserOverrideFlag}
CALL Post_Process
EXIT

This example references the Input_Overrides rule group. The example specifies an action that occurs when a rule in the rule group applies to the input record.

PROCESS_RC RuleGroup1 RC_Return RuleID
[ RC_Return = "1" ] ; A rule in the rule group applies to the input record: CALL Post_Process SUBROUTINE then EXIT
COPY RuleID {RuleID}; Add the name of the rule that applied to the record to the RuleID output column
COPY "RuleGroup1" {RuleGroupName}; Add the name of the rule group to the RuleGroupName output column
CALL Post_Process
EXIT

This example references the RuleGroup1 rule group and uses the RuleID argument. An action copies the name of any rule in the rule group that applied to an input record to the RuleID output column. A different action adds the name of the rule group to the RuleGroupName output column. Before the actions are executed, the output columns that they reference must be added to the dictionary file.