The Logical Operators, NOT, AND, OR

Logical operators can return only the values of 1 or 0. The NOT operator (í■ or \) in front of a term reverses its value either from true to false or from false to true.

SAY  \ 0         /* gives '1'         */
SAY  \ 1         /* gives '0'         */
SAY  \ (4 = 4)   /* gives '0'         */
SAY  \ 2         /* gives  a  syntax error      */

The AND operator (&) between two terms gives a value of true only if both terms are true.

SAY ( 3 = 3 ) & ( 5 = 5 )   /* gives '1'                     */
SAY ( 3 = 4 ) & ( 5 = 5 )   /* gives '0'                     */
SAY ( 3 = 3 ) & ( 4 = 5 )   /* gives '0'                     */
SAY ( 3 = 4 ) & ( 4 = 5 )   /* gives '0'                     */

The OR operator ( | ) between two terms gives a value of true unless both terms are false.

┴╓: Depending upon your Personal System keyboard and the code page you are using, you may not have the solid vertical bar to select. For this reason, REXX also recognizes the use of the split vertical bar as a logical OR symbol. Some keyboards may have both characters. If so, they are not interchangeable; only the character that is equal to the ASCII value of 124 works as the logical OR. This type of mismatch can also cause the character on your screen to be different from the character on your keyboard.