
Operator
Meaning
&
AND
Returns
1
if both comparisons are true. For example:
(4 > 2) & (a = a)
/* true, so result is 1
*/
(2 > 4) & (a = a)
/* false, so result is 0 */
|
Inclusive OR
Returns
1
if at least one comparison is true. For example:
(4 > 2) | (5 = 3)
/* at least one is true, so result is 1 */
(2 > 4) | (5 = 3)
/* neither one is true, so result is 0
*/
&&
Exclusive OR
Returns
1
if only one comparison (but not both) is true. For example:
(4 > 2) && (5 = 3)
/* only one is true, so result is 1
*/
(4 > 2) && (5 = 5)
/* both are true, so result is 0
*/
(2 > 4) && (5 = 3)
/* neither one is true, so result is 0 */
Prefix \,
¬
Logical NOT
Negates—returning the opposite response. For example:
\ 0
/* opposite of 0, so result is 1
*/
\ (4 > 2)
/* opposite of true, so result is 0 */
Using Logical Expressions
You can use logical expressions in complex conditional instructions and as checkpoints to screen
unwanted conditions. When you have a series of logical expressions, for clarification, use one or more
sets of parentheses to enclose each expression.
IF ((A < B) | (J < D)) & ((M = Q) | (M = D)) THEN ....
The following example uses logical operators to make a decision.
When arguments passed to this example are
SPRING YES NO
, the IF clause translates as follows:
IF ((season = 'WINTER') | (snowing ='YES')) & (broken_leg ='NO') THEN
\______________/
\____________/
\_____________/
false
true
true
/****************************** REXX ********************************/
/* This program receives arguments for a complex logical expression */
/* that determines whether a person should go skiing.
The first
*/
/* argument is a season and the other two can be 'yes' or 'no'.
*/
/********************************************************************/
PARSE ARG season snowing broken_leg
IF ((season = 'WINTER') | (snowing ='YES')) & (broken_leg ='NO')
THEN SAY 'Go skiing.'
ELSE
SAY 'Stay home.'
Figure 13. Example Using Logical Expressions
Using Variables and Expressions
26
CICS TS for VSE/ESA: REXX Guide
Summary of Contents for SC34-5764-01
Page 1: ...CICS Transaction Server for VSE ESA REXX Guide SC34 5764 01...
Page 2: ......
Page 3: ...CICS Transaction Server for VSE ESA REXX Guide SC34 5764 01...
Page 22: ...xx CICS TS for VSE ESA REXX Guide...
Page 23: ...Part 1 User s Guide Copyright IBM Corp 1992 2009 1...
Page 24: ...2 CICS TS for VSE ESA REXX Guide...
Page 40: ...18 CICS TS for VSE ESA REXX Guide...
Page 54: ...Using Variables and Expressions 32 CICS TS for VSE ESA REXX Guide...
Page 106: ...84 CICS TS for VSE ESA REXX Guide...
Page 110: ...88 CICS TS for VSE ESA REXX Guide...
Page 122: ...100 CICS TS for VSE ESA REXX Guide...
Page 123: ...Part 2 Reference Copyright IBM Corp 1992 2009 101...
Page 124: ...102 CICS TS for VSE ESA REXX Guide...
Page 130: ...Introduction 108 CICS TS for VSE ESA REXX Guide...
Page 152: ...REXX General Concepts 130 CICS TS for VSE ESA REXX Guide...
Page 224: ...Functions 202 CICS TS for VSE ESA REXX Guide...
Page 252: ...230 CICS TS for VSE ESA REXX Guide...
Page 278: ...256 CICS TS for VSE ESA REXX Guide...
Page 312: ...DB2 Interface 290 CICS TS for VSE ESA REXX Guide...
Page 316: ...High level Client Server Support 294 CICS TS for VSE ESA REXX Guide...
Page 340: ...318 CICS TS for VSE ESA REXX Guide...
Page 344: ...for execs Commands 322 CICS TS for VSE ESA REXX Guide...
Page 399: ...Part 3 Appendixes Copyright IBM Corp 1992 2009 377...
Page 400: ...378 CICS TS for VSE ESA REXX Guide...
Page 438: ...416 CICS TS for VSE ESA REXX Guide...
Page 442: ...System Definition Customization Administration 420 CICS TS for VSE ESA REXX Guide...
Page 446: ...Security 424 CICS TS for VSE ESA REXX Guide...
Page 448: ...426 CICS TS for VSE ESA REXX Guide...
Page 464: ...442 CICS TS for VSE ESA REXX Guide...
Page 466: ...444 CICS TS for VSE ESA REXX Guide...
Page 468: ...446 CICS TS for VSE ESA REXX Guide...
Page 476: ...454 CICS TS for VSE ESA REXX Guide...
Page 478: ...456 CICS TS for VSE ESA REXX Guide...
Page 479: ......
Page 480: ...SC34 5764 01...
Page 481: ...Spine information CICS TS for VSE ESA REXX Guide...