COMP (Compare)

Free-Form Syntax (not allowed - use the use the =, <, <=, >, >=, or <> operators)
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:

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.

Figure 300. COMP Operation
*...1....+....2....+....3....+....4....+....5....+....6....+....7...+....
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq....
 *
 *  Initial field values are:
 *                    FLDA = 100.00
 *                    FLDB = 105.00
 *                    FLDC = 100.00
 *                    FLDD = ABC
 *                    FLDE = ABCDE
 *
 *  Indicator 12 is set on; indicators 11 and 13 are set off.
C     FLDA          COMP      FLDB                               111213
 *
 *  Indicator 15 is set on; indicator 14 is set off.
C     FLDA          COMP      FLDB                               141515
 *
 *  Indicator 18 is set on; indicator 17 is set off.
C     FLDA          COMP      FLDC                               171718
 *
 *  Indicator 21 is set on; indicators 20 and 22 are set off
C     FLDD          COMP      FLDE                               202122


[ Top of Page | Previous Page | Next Page | Contents | Index ]