Operators

The table below lists every Enrichment operator along with its type, a brief description, proper syntax, and processing precedence. Enrichment evaluates mathematical expressions from left to right according to the indicated operator precedence. If a mathematical expression contains parentheses, Enrichment evaluates expressions within the parentheses first.

Note: Enrichment does not support decimal math. You can only perform mathematical operations on whole numbers.
Table 1. Operators
Operator Types Description Syntax Precedence
() Any Open and close parentheses (...) 1
- Arithmetic Unary minus -%%x 2
* Arithmetic Multiplication %%x * %%y 3
% Arithmetic Division (integer) %%x % %%y 3
# Arithmetic Remainder %%x # %%y 3
+ Arithmetic Addition %%x + %%y 4
- Arithmetic Subtraction %%x - %%y 4
| String Concatenate %%x | %%y
Note: On mainframe systems you can use either a solid vertical bar (|, EBCDIC X’4F’) or a broken vertical bar (¦, EBCDIC X’6A’) as a concatenation character. On UNIX and Linux systems, the vertical bar is sometimes displayed solid, sometimes broken, but is always ASCII X’7C’.
5
= Comparison Equality IF %%x = %%y THEN 6
!= \= <> Comparison Inequality IF %%x != %%y THEN 6
< Comparison Less than IF %%x < %%y THEN 6
<= Comparison Less than or equal to IF %%x <= %%y THEN 6
> Comparison Greater than IF %%x > %%y THEN 6
>= Comparison Greater than or equal to IF %%x >= %%y THEN 6
@ Comparison Checks if the first string is contained in the second string. %%x @ "KY TN IN"

For example, the statement

%%state @ KY CA NC CT

is TRUE if %%state is any of the following:

  • K
  • KY C
  • KY CA
  • CA

It is FALSE if %%state is:

  • CA KY
  • KY CT
6
@= Comparison Use wildcards with this operator to match a pattern. Case sensitive. %%x @= "K* T*"

For example, the statement

%%state @= "K* C*"

is TRUE if %%state is "KY CA".

It is FALSE if %%state is "KY NY".

It is also FALSE if %%state is "ky ca"

6
*= Comparison Use wildcards with this operator to match a pattern. Not case sensitive. %%x @= "K* T*"

For example, the statement

%%state @= "K* C* n* c*"

is TRUE if %%state is "KY CA NC CT:.

It is FALSE if %%state is "KY NC".

6
NOT Boolean Not IF NOT expression1 THEN 7
AND Boolean And IF expression1 AND expression2 THEN 8
OR Boolean Or IF expression1 OR exression2 then 8