MPE/iX Commands Reference Manual (32650-90877)

Appendix B 639
Expression Evaluator Functions
B Expression Evaluator Functions
The expression evaluator is a system procedure used by the user interface to accept a
string, number, or Boolean expression, evaluate it, and return the result. This procedure is
used by the CALC, SETVAR, IF, ELSEIF, and WHILE commands and within a ![ ]..
The expression evaluator provides the following:
consistent evaluation of expressions
compatibility with MPE V/E job control word evaluation
user flexibility
The expression evaluator uses algebraic notation and supports the functions defined in
Table B-1. on page 639. The references that appear in this table in parentheses, for
example (8), are defined following the table.
See HELP for description of new functions and examples.
E.g. HELP FSYNTAX
Table B-1. Expression Evaluator Functions
Symbol Function Example Result
+(numeric) addition 4 + 5 9
+(string) concatenate “abc‘ + “de‘ abcde
-(numeric) subtraction 12 - 6 6
-(string) deletion of first
occurrence
“abc‘ - “b‘ ac
* multiplication 4 * 5 20
/ integer division 79/ 10 7
ˆ exponentiation
(9)
2ˆ3 8
either “ or ‘ string identifier either “abc‘ or “abc‘ abc
() parentheses (3 + 4) * 2 14
< less than (1) 5 < 6 TRUE
<= less than or
equal (1)
“abc‘ <= “abc‘ TRUE
> greater than (1) “xyz‘ > “abc‘ TRUE
>= greater than or
equal (1)
“abc‘>= “abc‘ TRUE
<> not equal 5 <> 6 TRUE