Conditionals

Several controls in the file standards validation rules allow conditionals to be used. Conditionals return either true or false and are used to control whether a specific operation is enabled or not.

Conditionals are used for both content and collector validation. The following types of conditionals can be used.
  • Conditions that test a field. The field conditional can be used for both content and collector validation.
  • Conditions that test a collector. The collector conditional can only be used for collector validation.

A conditional can be used to control whether each of the activation, execution, and evaluation phases of collector validation is run or not. When the conditional for a phase returns true, the phase is run. For more information about defining collectors, see Collector content validation rules.

Conditions for fields

A field conditional definition is similar to the definition for the values check. The main difference is that the values check has value in {} in its clause, but the field conditional does not. For more information about formatting a conditional, see If Operator.

The following example is the definition of the condition for a field.
If FIELD:record type, offset, length, type in {set of values}
where:
record type
Indicates the previous record type in which to look for the field. If the record type is the same as the current record, the field from the current record is used.
offset
Contains the offset of the referenced field.
length
Contains the length of the referenced field.
type
Indicates the type of comparison to be done:
N
Indicates comparisons are done as a number. All values are converted to numeric before being compared.
D
Indicates comparisons are done as a date. It has the same available features as a numeric field.
A
Indicates comparisons are done as a string.
set of values
The list of valid values for the field. The format of the list depends on the field. For more information about how to specify the set of values inside the braces, see the following topics.
  • Value in and Value not in Clauses
  • Field Operator
  • Format Operator
  • Regular Expression Operator

Conditions for collectors

The following example is the definition of the condition for a collector.
If COLLECTOR:name in {set of values}
where:
name
The name of the collector from which the value is retrieved.
set of values
Comparisons to a collector value are treated as numeric.