Easytrieve LE Operator

LE is the keyword spelling for less than or equal in Broadcom relational operator documentation. IF SCORE LE 59 flags failing grades including exactly fifty-nine. IF DISCOUNT LE MAX-DISCOUNT keeps employees at the discount cap in the eligible set. IF EFF-DATE LE CYCLE-END retains records effective on or before the cycle close. Inclusive LE differs from strict LT: when SCORE is exactly sixty, IF SCORE LE 60 passes but IF SCORE LT 60 fails. Symbolic <= expresses the same inclusive test; LE reads clearly on printed listings beside EQ NE GT GE LT. Numeric LE compares magnitude with implied decimals. Alphabetic LE uses collating sequence—on z/OS typically EBCDIC. Beginners code LT when policy says at most or up to and including—auditors then dispute missing boundary records. This page teaches LE syntax, equivalence with <=, contrast with LT and GE, field-to-field ceiling tests, date and amount thresholds, THRU range combinations, logical AND patterns for banded logic, and validation at exact boundary values for limit-driven Easytrieve batch jobs.

Progress0 of 0 lessons

LE in Conditional Expressions

LE appears between operands in IF, ELSE-IF, DO WHILE, and nested JOB logic. IF BALANCE LE 0 includes zero-balance accounts. IF EFF-DATE LE CUTOFF-DATE selects records on or before a policy change. IF HOURS LE STD-HOURS includes full-time schedules at exactly standard hours. True when left orders before or equal to right; false only when left is strictly greater.

text
1
2
3
4
5
6
7
8
JOB INPUT PAYROLL IF GROSS LE MIN-WAGE PRINT AT-MINIMUM-RPT END-IF IF HOURS LE STD-HOURS PRINT REGULAR-SCHED-RPT END-IF

LE Versus Symbolic <=

Less than or equal operator forms
FormExampleAt equality
Keyword LEIF AMT LE 100
Symbolic <=IF AMT <= 100
Keyword LTIF AMT LT 100
Keyword GEIF AMT GE 100

Inclusive LE Versus Strict LT

Policy language at most sixty hours maps to LE 60, not LT 60, when exactly sixty must pass. Failing grades at or below fifty-nine map to LE 59 when fifty-nine is the highest failing score. Misreading policy as strict LT when the boundary belongs in the set causes off-by-one production bugs. Document boundary intent beside the IF when compliance depends on it. At exactly the boundary value, LE and LT always disagree—that is the test case auditors request first.

Numeric LE

Packed P 2 currency: 100.00 LE 100.00 is true. Negative numbers order below positive: IF BALANCE LE 0 includes overdraft and zero. IF TAX LE FLOOR-TAX compares two fields—types and scales must align. Implied decimal alignment matters: P 2 compared to N 5 may promote per compiler rules—test in development. IF COUNT LE MAX-CAP enforces volume ceilings including records at the cap.

Alphabetic LE

IF CODE LE M includes codes collating before or equal to M in EBCDIC—often A through M ranges depending on literal and field definition. IF NAME LE SMITH selects names sorting before or equal to SMITH in directory order. Trailing spaces participate: shorter effective values padded to field length compare as longer strings with spaces. Quote literals to match business length for single-character range splits.

text
1
2
3
4
5
6
7
8
JOB INPUT INVENTORY IF ON-HAND LE REORDER-PT PRINT ADEQUATE-STOCK-RPT END-IF IF WHSE-CODE LE 'M' PRINT ZONE-A-THRU-M-RPT END-IF

Field-to-Field LE

IF CURR-DATE LE EXP-DATE identifies certificates not yet expired when dates compare as numeric or character per format—equality means expires on that day. IF ACTUAL LE BUDGET flags underspend lines including exact budget match. IF SCORE LE PASS-LEVEL compares examinee to cutoff field defined in Library. Mismatched date formats—MMDDYY versus CCYYMMDD—make LE meaningless without conversion fields.

LE With THRU and Banded Logic

Closed upper bands use LE alone: IF AGE LE 17 for minors when seventeen is included. Open lower with closed upper combines operators: IF AGE GE 18 AND AGE LE 65 for working-age window. EQ THRU expresses inclusive ranges on both ends—IF CODE EQ 1 THRU 5 differs from IF CODE LE 5 when code zero should exclude. Choose LE for single inclusive ceiling; combine GE and LE for windows; use THRU when both endpoints are fixed constants.

LE in Logical Expressions

IF AMT LE 0 OR AMT GE 1000 flags outliers both tails. IF NOT AMT LE 100 expresses strictly-greater-than-one-hundred logic—prefer GT 100 for readability. Parentheses clarify: IF (SCORE LE 59) AND (ATTEND GE 80). Chained IF A LE B LE C is not valid in most grammars—split into AND conditions with separate LE tests.

Date and Time LE

When dates store as packed or character YYYYMMDD, LE compares chronologically if formats align. IF TRAN-DATE LE CUTOFF includes transactions on the cutoff day—use LT with adjusted cutoff for exclusive end dates. Julian versus Gregorian layouts must match before LE tests mean what schedulers expect. Same-day cutoffs are the classic LE versus LT decision point in month-end jobs.

Testing LE Logic

  1. Test value one below, at, and one above boundary—LE must pass at boundary.
  2. Verify negative and zero numeric LE behavior.
  3. Test alphabetic LE at range edges with padded fields.
  4. Confirm date LE with aligned formats on cutoff day.
  5. Compare LE versus LT outcomes at exact policy boundary.

Common LE Mistakes

  • Using LT when policy means at most—should be LE.
  • Confusing LE with GE—LE caps from above, GE floors from below.
  • Comparing dates in mismatched formats.
  • Assuming alphabetic LE ignores trailing spaces.
  • Chained relational expressions not supported—use AND.
  • Mixing LE and <= without team convention.

Explain It Like I'm Five

LE means the same size or smaller. If the rule is kids who are this tall or shorter get the small sticker, you measure against the line. Exactly as tall as the line still counts because LE includes same size. LT would mean only shorter than the line—exactly as tall would not count. LE is the word version of the less-than-or-equal sign. Numbers on the number line at or below the limit pass. Letters at or before the limit letter in the computer alphabet pass too.

Exercises

  1. Write IF GROSS LE MIN-WAGE PRINT using LE keyword only.
  2. Explain LE versus LT when failing grade includes exactly fifty-nine.
  3. Write IF ON-HAND LE REORDER-PT adequate-stock filter.
  4. Build working-age band IF AGE GE 18 AND AGE LE 65.
  5. Describe EBCDIC impact on IF CODE LE M.

Quiz

Test Your Knowledge

1. IF SCORE LE 59 means:

  • SCORE is 59 or below
  • SCORE is strictly below 59
  • Assign 59 to SCORE
  • SCORE equals 59 only

2. LE and symbolic <= in IF AMT LE 100 versus IF AMT <= 100:

  • Both express inclusive upper bound
  • LE assigns and <= compares
  • Only LE valid
  • Only <= valid

3. IF DISCOUNT LE MAX-DISCOUNT at exact cap:

  • Passes when equal to cap
  • Fails when equal to cap
  • Compile error
  • Only for dates

4. IF AGE LE 17 compared to IF AGE LT 18 for integer ages:

  • Often equivalent for whole-number ages
  • Never equivalent
  • LE is assignment only
  • LT includes equality

5. IF EFF-DATE LE CUTOFF keeps records:

  • On or before cutoff date
  • After cutoff only
  • Unconditionally
  • With compile error
Published
Read time15 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 LE keyword less than or equal in conditional expressionsSources: Broadcom Easytrieve Report Generator 11.6 Language Reference relational operatorsApplies to: Easytrieve LE operator in comparisons