Logical (Boolean) Operators

Logical expressions, like comparison expressions, return 1 (true) or 0 (false) when processed. Logical operators combine two comparisons and return 1 or 0 depending on the results of the comparisons.

The logical operators are:
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 */

Reference Reference

Feedback


Timestamp icon Last updated: Tuesday, 7 January 2014


http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/topic/com.ibm.cics.rexx.doc//dfhrx/rvse017.html