Compare Operations

The compare operations are shown in the following table.

Table 63. Compare Operations
Operation Traditional Syntax Free-Form Syntax
And ANDxx (And) AND operator
Compare COMP (Compare) =, <, >, <=, >=, or <> operator
Compare and Branch CABxx (Compare and Branch) (not allowed)
Conditional Subroutine CASxx (Conditionally Invoke Subroutine) IF (If) and EXSR (Invoke Subroutine)
Do Until DOU (Do Until) or DOUxx (Do Until) DOU (Do Until)
Do While DOW (Do While) or DOWxx (Do While) DOW (Do While)
If IF (If) or IFxx (If) IF (If)
Or ORxx (Or) OR operator
When WHEN (When True Then Select) or WHENxx (When True Then Select) WHEN (When True Then Select)

In the ANDxx, CABxx, CASxx, DOUxx, DOWxx, IFxx, ORxx, and WHENxx operations, xx can be:

xx
Meaning
GT
Factor 1 is greater than factor 2.
LT
Factor 1 is less than factor 2.
EQ
Factor 1 is equal to factor 2.
NE
Factor 1 is not equal to factor 2.
GE
Factor 1 is greater than or equal to factor 2.
LE
Factor 1 is less than or equal to factor 2.
Blanks
Unconditional processing (CASxx or CABxx).

The compare operations test fields for the conditions specified in the operations. These operations do not change the values of the fields. For COMP, CABXX, and CASXX, the resulting indicators assigned in postions 71 and 76 are set according to the results of the operation. All data types may be compared to fields of the same data type.

Remember the following when using the compare operations:

Attention!

Note the following points, especially if you want to avoid unpredictable results.



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