Priority Of Operators - IBM SC34-5764-01 Manual

Cics transaction server for vse/esa
Table of Contents

Advertisement

Using Variables and Expressions
/****************************** REXX *********************************/
/* This program formats data into columns for output.
/*********************************************************************/
sport = 'base'
equipment = 'ball'
column = '
'
cost = 5
SAY sport||equipment column '£' cost
Figure 14. Example Using Concatenation Operators
The result of this example is:
baseball
£ 5
A more sophisticated way to format information is with parsing and templates. Information about parsing
appears in section "Parsing Data" on page 73.

Priority of Operators

When more than one type of operator appears in an expression, what operation does the language
processor do first?
IF (A > 7**B) & (B < 3)
Like the priority of operators for the arithmetic operators, there is an overall priority that includes all
operators. The priority of operators is as follows with the highest first.
Table 2. Overall Operator Priority
\ or ¬ - +
**
* / % //
+ -
blank || abuttal
== = >< and so on
&
| &&
Thus, given the following values
A = 8
B = 2
C = 10
the language processor would evaluate the previous example
IF (A > 7**B) & (B < 3)
as follows:
1. Evaluate what is inside the first set of parentheses.
a. Evaluate A to 8.
b. Evaluate B to 2.
c. Evaluate 7**2.
d. Evaluate 8 > 49 is false (0).
2. Evaluate what is inside the next set of parentheses.
a. Evaluate B to 2.
b. Evaluate 2 < 3 is true (1).
28
CICS TS for VSE/ESA: REXX Guide
Prefix operators
Power (exponential)
Multiply and divide
Add and subtract
Concatenation operators
Comparison operators
Logical AND
Inclusive OR and exclusive OR
*/

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rexx

Table of Contents