The strictly equal and equal operators, Using comparison expressions – IBM SC34-5764-01 User Manual

Page 46

Advertising
background image

For example, if A = 4 and Z = 3, then the results of the previous comparison questions are:

(A = Z)

Does 4 = 3?

0 (False)

(A > Z)

Is 4 > 3?

1 (True)

(A < Z)

Is 4 < 3?

0 (False)

The more commonly used comparison operators are as follows:

Operator

Meaning

=

Equal

==

Strictly Equal

\ =

Not equal

\ ==

Not strictly equal

>

Greater than

<

Less than

> <

Greater than or less than (same as not equal)

> =

Greater than or equal to

\ <

Not less than

< =

Less than or equal to

\ >

Not greater than

Note: The NOT character (¬) is synonymous with the backslash (\). You can use the two characters

interchangeably according to availability and personal preference. This book uses the backslash (\)
character.

The Strictly Equal and Equal Operators

When two expressions are strictly equal, everything including the blanks and case (when the expressions
are characters) is exactly the same.

When two expressions are equal, they are resolved to be the same. The following expressions are all
true.

'WORD' = word

/* returns 1 */

'word ' \== word

/* returns 1 */

'word' == 'word'

/* returns 1 */

4e2 \== 400

/* returns 1 */

4e2 \= 100

/* returns 1 */

Using Comparison Expressions

You often use a comparison expression in an IF...THEN...ELSE instruction. The following example uses an
IF...THEN...ELSE instruction to compare two values. For more information about this instruction, see
section “IF...THEN...ELSE Instructions” on page 33.

Using Variables and Expressions

24

CICS TS for VSE/ESA: REXX Guide

Advertising