Comparison operators can compare numbers or strings and ask questions, such as:
Are the terms equal?
(A = B)
Is the first term greater than the second?
(A > B)
Is the first term less than the second?
(A < B)
For example, if A = 4 and B = 3, then the results of the previous comparison
questions are:
(A = B) Does 4 = 3?
0
(False)
(A > B) Is 4 > 3?
1
(True)
(A < B) Is 4 < 3?
0
(False)
The more commonly used comparison operators are as follows:
Operator
Meaning
==
Strictly Equal
=
Equal
\ ==
Not strictly equal
\ =
Not 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 ("\"). The two
characters may be used 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
Often a comparison expression is used in IF/THEN/ELSE instructions. The following
example uses an IF/THEN/ELSE instruction to compare two values. For more
information about this instruction, see “IF/THEN/ELSE Instructions” on page 42.
Using Expressions
Chapter 3. Using Variables and Expressions
31
Содержание TSO/E REXX
Страница 1: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 2: ......
Страница 3: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 10: ...viii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 12: ...x z OS V1R1 0 TSO E REXX User s Guide ...
Страница 14: ...xii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 18: ...xvi z OS V1R1 0 TSO E REXX User s Guide ...
Страница 20: ...2 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 58: ...Tracing Expressions with the TRACE Instruction 40 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 78: ...60 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 86: ...Built In Functions 68 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 128: ...Issuing Other Types of Commands from an Exec 110 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 136: ...Debugging Execs 118 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 170: ...Protecting Elements in the Data Stack 152 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 201: ...Part 3 Appendixes Copyright IBM Corp 1988 2001 183 ...
Страница 202: ...184 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 222: ...Using Variables 204 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 226: ...208 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 238: ...220 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 241: ......