Parentheses And Operator Precedence - IBM SC34-5764-01 Manual

Cics transaction server for vse/esa
Table of Contents

Advertisement

REXX General Concepts
>>=
Strictly greater than or equal to
\<<, ¬<<
Strictly NOT less than
<<=
Strictly less than or equal to
\>>, ¬>>
Strictly NOT greater than
Note: Throughout the language, the not character, ¬, is synonymous with the backslash (\). You can use
the two characters interchangeably, according to availability and personal preference. The
backslash can appear in the following operators: \ (prefix not), \=, \==, \<, \>, \<<, and \>>.
Logical (Boolean)
A character string is taken to have the value false if it is 0, and true if it is 1. The logical operators take one
or two such values (values other than 0 or 1 are not allowed) and return 0 or 1 as appropriate:
&
AND
Returns 1 if both terms are true.
|
Inclusive OR
Returns 1 if either term is true.
&&
Exclusive OR
Returns 1 if either (but not both) is true.
Prefix \,¬
Logical NOT
Negates; 1 becomes 0, and 0 becomes 1.

Parentheses and Operator Precedence

Expression evaluation is from left to right; parentheses and operator precedence modify this:
v When parentheses are encountered (other than those that identify function calls) the entire
subexpression between the parentheses is evaluated immediately when the term is required.
v When the sequence:
term1 operator1 term2 operator2 term3
is encountered, and operator2 has a higher precedence than operator1, the subexpression (term2
operator2 term3) is evaluated first. The same rule is applied repeatedly as necessary.
Note, however, that individual terms are evaluated from left to right in the expression (that is, as soon
as they are encountered). The precedence rules affect only the order of operations.
For example, * (multiply) has a higher priority than + (add), so 3+2*5 evaluates to 13 (rather than the 25
that would result if strict left to right evaluation occurred). To force the addition to occur before the
multiplication, you could rewrite the expression as (3+2)*5. Adding the parentheses makes the first three
tokens a subexpression. Similarly, the expression -3**2 evaluates to 9 (instead of -9) because the prefix
minus operator has a higher priority than the power operator.
The order of precedence of the operators is (highest at the top):
+ - ¬ \ (prefix operators)
**
(power)
* / % //
(multiply and divide)
+ -
(add and subtract)
(blank) || (abuttal)
(concatenation with or without blank)
118
CICS TS for VSE/ESA: REXX Guide

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rexx

Table of Contents