Rules

Along with cases, rules are the basic building blocks of a rule procedure. Build processing rules using the user-defined command templates in the Rule Editor.

Some commands require significantly more input fields that others, depending on the complexity of the command’s function.

You can use logical expressions and nested parentheses within your rules to combine multiple commands in a single rule. This allows you to implement quite complex business rules within your rule procedure.

The Rule Editor provides a variety of user-definable commands for building rules; these commands are discussed in more detail in the following topics.

This topic mentions a few commands used for reporting and to communicate balancing results or to trigger external software applications. These commands are discussed in more detail in the Production Mode and Viewing Results topics.

Control totals balancing rules

A&AS provides a standard list of definable commands you can use to build Control Totals Balancing rules. No rules are provided by default for this type of balancing rule procedure.

Item reconciliation rules

In addition to a standard list of definable commands you can use to build rules, Item Reconciliation rule procedures also provide a RECONCILE rule by default. This rule comes with default ON_MATCHED and ON_NOT_MATCHED cases under it. You cannot delete the RECONCILE rule or its cases.

The RECONCILE rule definition requires that you specify two or more data source variables. These data source variables indicate the location of the data sources that the rule procedure should reconcile.

The RECONCILE rule parses every value in the sorted data source files and checks to see if each value is present in all files. If a value is present in all files (matched), the RECONCILE rule executes the ON_MATCHED case, along with any rules contained under it. If a value is not present in all files (not matched), the RECONCILE rule executes the ON_NOT_MATCHED case, along with the rules contained under it.

You might want to create several ON_NOT_MATCHED subcases to define what actions the reconcile rule should perform depending on which values were missing from which data sources.

For example, a value present in data source A but missing from data source B might not indicate a problem, whereas the same value missing from data source A might be a serious problem.

In that case, you might define a RECONCILE rule whose ON_NOT_MATCHED subcases included FOUND and MISSING conditions similar to this:
RECONCILE A, B ON_MATCHED  PRINTLOG ("Value” +VALUE + “reconciled. Everything is fine.") ON_NOT_MATCHED  ON (MISSING IN B) AND (FOUND IN A)   PRINTLOG ("Value” +VALUE +”is missing from data    source” +DATASOURCEB + “. But don’t worry.")  ON MISSING IN A   PRINTLOG ("Value” +VALUE +”is missing from data    source” +DATASOURCEA + “. This is a    disaster. Panic!")