Easytrieve Less Than or Equal Operator (<=)

Less than or equal combines ordering with equality: the left value must not exceed the right boundary. IF SCORE <= 59 flags failing grades including exactly fifty-nine. IF AGE <= 17 selects minors when policy uses seventeen or younger. IF EFF-DATE <= CUTOFF-DATE retains records effective on or before a cycle end. Symbolic <= pairs with keyword LE from Broadcom manuals. Beginners reach for < when policy language says or equal—auditors then dispute whether boundary records should appear. Inclusive bounds matter for money: IF DISCOUNT <= MAX-DISCOUNT includes employees at the cap. Date cutoffs without <= accidentally drop same-day transactions. This page teaches <= syntax, LE equivalence, contrast with strict <, integer boundary equivalences, date and amount ceiling patterns, combination with AND for banded ranges, and testing at exact boundary values.

Progress0 of 0 lessons

Basic Syntax

Less than or equal appears in IF and similar conditions: IF AMT <= 100, IF LEVEL <= MAX-LEVEL, IF HIRE-DATE <= TODAY. True when left is less than or equal to right.

text
1
2
3
4
5
6
7
8
JOB INPUT STUDENT IF SCORE <= 59 PRINT FAILING-RPT END-IF IF DISC-PCT <= MAX-DISC APPLY-DISCOUNT = Y END-IF

<= Versus LE

Less than or equal forms
FormExampleWhen value equals 100
<=IF AMT <= 100
LEIF AMT LE 100
<IF AMT < 100
LTIF AMT LT 100

Inclusive Boundary Semantics

At exact boundary, <= yields true and < yields false. Policy at most one hundred dollars maps to <= 100. Policy under one hundred maps to < 100. Misstating costs money in payroll caps and tax brackets. Document boundary in comment when translating business requirements into Easytrieve IF.

Integer Age and Grade Equivalences

For whole-number ages, IF AGE <= 17 often matches IF AGE < 18—both include seventeen-year-olds and exclude eighteen. Choose form matching policy wording. Non-integer ages or fractional scores break equivalence—IF SCORE <= 59.5 differs from IF SCORE < 60 when half points exist.

Numeric Ceiling and Cap Patterns

IF WITHHOLD <= MAX-WITHHOLD validates tax within legal cap including employees at cap. IF CLAIM <= POLICY-LIMIT insurance processing. Packed decimal P 2 compares at implied scale—100.00 <= 100.00 is true. Accumulator guard: IF RUNNING-TOT <= LIMIT prevents exceeding ceiling in same job when procedural logic increments totals.

Date On-or-Before Cutoff

IF TRANS-DATE <= CYCLE-END includes transactions on cycle end day. Date fields must use comparable internal representation—packed dates, Julian, or standard formats per DEFINE. Mixing display format FILE date with working storage date without conversion yields wrong boundary results. Test record exactly on cutoff date in QA file.

text
1
2
3
4
JOB INPUT TRANS IF TRANS-DATE <= CYCLE-END-DATE PRINT CURRENT-CYCLE-RPT END-IF

Banded Ranges With AND

IF SCORE >= 60 AND SCORE <= 79 defines passing band C when both bounds inclusive. Lower bound uses >= or GE; upper uses <= or LE. Open interval IF SCORE > 60 AND SCORE < 80 excludes both endpoints. THRU alternative: IF SCORE EQ 60 THRU 79 inclusive on both ends per THRU rules—compare readability with your team.

<= With Arithmetic

IF BASE + BONUS <= CAP sums before inclusive compare. IF A <= B + TOLERANCE allows field B plus margin. Parentheses document: IF (X + Y) <= LIMIT.

Alphabetic Less Than or Equal

IF CODE <= M includes codes collating before M and codes equal to M under field length and padding rules. Trailing spaces affect equality at boundary literal—verify A field length matches comparison literal padding.

Common <= Mistakes

  • Using < when policy includes equals at boundary.
  • Assuming <= 17 and < 18 equivalent for non-integer values.
  • Date compare without aligned internal formats.
  • Wrong decimal scale on boundary literal.
  • Mixing <= and LE without convention.
  • Upper and lower bounds both inclusive without documenting closed interval.

Explain It Like I'm Five

Less than or equal means up to and including the line. If you may take up to three cookies, three cookies is still okay— not too many. Strict less than means you must stay under the line, so three cookies might be too many if the sign said under three. The <= sign is the computer way of saying not bigger than, and same size counts too.

Exercises

  1. Write failing-grade IF SCORE <= 59 with PRINT.
  2. Explain truth at boundary 100 for <= versus <.
  3. Write date cutoff IF EFF-DATE <= CYCLE-END.
  4. Build band IF SCORE >= 70 AND SCORE <= 79.
  5. Rewrite IF AMT LE 50 using <= only.

Quiz

Test Your Knowledge

1. IF SCORE <= 59 means:

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

2. LE is:

  • Keyword less than or equal
  • Literal edit
  • Library entry
  • Line ending

3. IF AGE <= 17 compared to IF AGE < 18 for minors:

  • Often equivalent for integer ages
  • Never equivalent
  • LE is assignment only
  • <= only works on dates

4. IF EFF-DATE <= CUTOFF keeps records:

  • On or before cutoff date
  • After cutoff only
  • Unconditionally
  • With compile error

5. Strict < versus <= at boundary 100:

  • <= true at 100; < false at 100
  • Both false at 100
  • Both true at 100
  • < true at 100
Published
Read time15 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 symbolic <= less than or equal in conditional expressionsSources: Broadcom Easytrieve 11.6 Language Reference relational operatorsApplies to: Easytrieve less than or equal operator (<=)