# COMP (Compare)

Code |
Factor 1 |
Factor 2 |
Result Field |
Indicators |
||
---|---|---|---|---|---|---|

COMP |
Comparand |
Comparand |
HI | LO | EQ |

The COMP operation compares factor 1 with factor 2. Factor 1 and
factor 2 can contain a literal, a named constant, a field name, a
table name, an array element, a data structure, or a figurative constant.
Factor 1 and factor 2 must have the same data type. As a result of
the comparison, indicators are set on as follows:

*High: (71-72)*Factor 1 is greater than factor 2.*Low: (73-74)*Factor 1 is less than factor 2.*Equal: (75-76)*Factor 1 equals factor 2.

You must specify at least one resulting indicator in positions 71 through 76. Do not specify the same indicator for all three conditions. When specified, the resulting indicators are set on or off (for each cycle) to reflect the results of the compare.

For further rules for the COMP operation, see Compare Operations.