Easytrieve Operators Overview

Operators are the action words of Easytrieve formulas. Plus adds. EQ tests equality. AND joins conditions. Equals sign assigns. Beginners meet operators first in assignment—NET = GROSS - TAX—then in IF blocks—IF STATUS EQ A AND GROSS GT LIMIT. Each operator family follows different rules: arithmetic respects numeric types and implied decimals; comparisons use collating sequence on alphabetic fields; logical connectors bind with precedence AND before OR; assignment evaluates the full right side before storing into the left target. This overview maps every major operator category, contrasts = with EQ, summarizes precedence, points to dedicated per-operator tutorial pages for exhaustive detail, and gives beginners a single reference before diving into addition, EQ, MOD, and NOT individually.

Progress0 of 0 lessons

Operator Families

Four families beginners use daily
FamilyOperatorsTypical context
Arithmetic+ - * / ** MODAssignment, numeric formulas
ComparisonEQ NE GT LT GE LE THRUIF DO WHILE conditions
LogicalAND OR NOTCombining conditions
Assignment=TARGET = expression

Assignment Operator =

Single equals assigns the evaluated right-hand expression into the left-hand field. NET = GROSS - TAX stores computed net. COUNT = COUNT + 1 increments. Assignment is not comparison—do not write IF STATUS = A; use IF STATUS EQ A. Multiple targets in one assignment are not standard—assign one field per statement for clarity. ROUNDED and TRUNCATED keywords follow the expression on assignment line. MOVE statement provides alternate assignment forms for some patterns—see MOVE documentation for bulk or group moves.

text
1
2
3
NET = GROSS - TOTAL-DEDUCT WS-COUNT = WS-COUNT + 1 TAX = GROSS * RATE ROUNDED

Arithmetic Operators Summary

Addition + sums operands. Subtraction - finds difference. Multiplication * scales values— common for percentages when literal 0.10 means ten percent. Division / computes quotient— guard zero divisor. Exponentiation ** raises power. MOD returns remainder after division. Each has a dedicated tutorial page with edge cases, type rules, and examples. Arithmetic binds tighter than comparison and logical operators unless parentheses override.

Arithmetic operators quick reference
OperatorDetail page
+/operators/addition
-/operators/subtraction
*/operators/multiplication
//operators/division
**/operators/exponentiation
MOD/operators/mod

Comparison Operators Summary

EQ equal, NE not equal, GT greater, LT less, GE greater or equal, LE less or equal. Symbolic forms = <> < > <= >= appear in some legacy code and documentation crosswalks—spelled forms dominate IF examples. THRU builds inclusive range: IF CODE EQ 10 THRU 20. Dedicated pages cover each operator and symbolic alias pairs like equal and EQ.

text
1
2
3
IF STATUS EQ 'A' IF GROSS GT LIMIT IF SERVICE EQ 1 THRU 5

Logical Operators Summary

AND requires all connected conditions true. OR requires at least one true. NOT negates supported condition forms. Logical operators bind loosest among expression operators except when parentheses group subconditions. Pages for AND OR NOT expand evaluation order, flag patterns, and NOT versus NE clarity.

text
1
2
3
IF GROSS NUMERIC AND GROSS GT 0 IF DEPT EQ 10 OR DEPT EQ 20 DO WHILE NOT EOF

Class Conditions vs Operators

NUMERIC ALPHABETIC ZERO POSITIVE NEGATIVE are class tests—not binary operators between two operands. They appear alongside operators in IF lines: IF FIELD NUMERIC AND FIELD GT 0. Boolean concepts page catalogs class conditions. Do not list them as arithmetic operators—they test field properties.

Precedence Summary

Parentheses innermost first. Then ** then * / then + - then relational EQ GT etc. then NOT then AND then OR. Full tables and worked examples on order of evaluation and parentheses pages. When two operators same precedence, typically left-to-right associativity for arithmetic—verify exponentiation stacks on your release.

Operands and Literals

Operators work on operands—fields, literals, constants. Literals page covers numeric and alphanumeric forms. System constants ZERO SPACE HIGH-VALUES LOW-VALUES EOF DUPLICATE participate in comparisons and MOVE—not all are operators themselves but act as operands in operator expressions.

Operators in Expressions Chapter

Expression pages organize by formula type—arithmetic, comparison, logical, mixed, nested. Operator pages organize by symbol. Use expressions chapter for how formulas combine; use operators chapter for deep dive on one symbol. Both views describe the same language grammar from different angles for learning.

Choosing the Right Operator

  1. Storing computed value—assignment = with arithmetic operators on right.
  2. Branching on threshold—comparison GT LT GE LE in IF.
  3. Multiple eligibility paths—OR between EQ comparisons.
  4. All guards required—AND between validation and business rule.
  5. Remainder logic—MOD or division pattern per shop standard.
  6. Negation—prefer NE over NOT EQ when clearer.

Common Operator Mistakes

  • = in IF instead of EQ.
  • EQ in assignment instead of =.
  • AND between raw fields without comparison.
  • Division by zero without guard.
  • Mixing symbolic and spelled forms inconsistently.
  • MOD confused with MASK display formatting.

Per-Operator Tutorial Pages

The operators section of this tutorial provides individual pages for each arithmetic, comparison, and logical operator. Follow sidebar links under Operators for addition through NOT, plus symbolic comparison aliases. Each page includes quizzes, exercises, and Broadcom-aligned examples for that single operator.

Explain It Like I'm Five

Operators are the action words between things. Plus combines numbers. EQ asks are they the same. AND says both questions must be yes. Equals sign puts an answer into a box. Easytrieve has different action words for math, for questions, and for putting answers away—learn which word works in which kind of sentence.

Exercises

  1. Label each operator family in NET = GROSS - TAX; IF NET GT 0 AND STATUS EQ A.
  2. Fix IF STATUS = A to use correct comparison operator.
  3. List six comparison operators and one use case each.
  4. Write IF using AND OR and one arithmetic comparison mix with parens.
  5. Pick three operators and find their dedicated pages in sidebar.

Quiz

Test Your Knowledge

1. Easytrieve assignment uses:

  • Single = to store value into field
  • EQ to store
  • ONLY MOVE
  • JCL SET

2. Arithmetic operators include:

  • + - * / and **
  • ONLY AND OR
  • ONLY EQ NE
  • DD names

3. Comparison operators include:

  • EQ NE GT LT GE LE and THRU ranges
  • Only + and -
  • Only NOT
  • FILE

4. Logical operators connect:

  • Conditions in IF and DO WHILE
  • FILE records
  • JCL steps
  • MACRO parameters only

5. MOD operator returns:

  • Remainder after division
  • Product
  • Exponent
  • File status
Published
Read time15 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 operator families arithmetic comparison logical assignmentSources: Broadcom Easytrieve 11.6 Language Reference operators and expressionsApplies to: Easytrieve operators overview