## Compare Field Across Files

The Compare Fields and Compare Fields Test statements allow you to test if field contents are identical across files. There are times when you need additional capabilities such as case insensitivity. This statement allow you to test if a single field is the same as across all files based on additional criteria.

As previously mentioned, you can specify that the comparisons are to be performed case insensitive.

You can specify that leading and trailing spaces are to be ignored.

Empty fields can be handled in one of four ways. Note that the emptiness of a field is only tested after the optional Ignore Leanding and Trailing spaces option is applied. The options are:

> No Special Empty Value Processing
>   Empty field values are treated the same as any other field value.
> Fail on Empty Values
>   Empty field values are not allowed and will cause the test to have a failed result.
> Ignore Empty Values
>   Empty field values are ignored and do not take part in the field comparisons.
> Ignore Empty Values Unless All Are Empty
>   Empty field values are ignored and do not take part in the field comparisons. However, if all the fields are empty, the test will have a result of failed.

The result will be true if the field is the same across all files. You can select the Not option to negate the result.

The result is either copied (Set) to the action test state, or alternately may be ANDed or ORed with the action test state.

The Indirect option specifies that the name of the field being compared is contained in the specified field. If you are using indirection, typically one of the variable fields would be used, however it is not mandatory. For example, if Variable 1 contained Artist, and you compare indirectly through Variable 1, you would be testing the Artist field's contents. Usage of this option will be rare. It does enable the writing of some generic actions to do processing. Note that the indirection will be applied for every file. This means in theory that different fields in different files could be compared. If the specifed field does not contain a valid field name, it will not match anything.