Easytrieve Less Than Operator (<)

Less than compares ordering: is the left value smaller than the right? Payroll uses it for threshold checks—IF GROSS < MINIMUM-WAGE triggers exception reports. Inventory jobs test IF ON-HAND < REORDER-POINT before PRINT replenishment lists. The symbolic < operator parallels keyword LT from Broadcom manuals. Strict less than excludes equality: IF SCORE < 60 fails when SCORE is exactly sixty; use <= when passing scores include the boundary. Numeric comparisons use numeric magnitude with implied decimals. Alphabetic comparisons use collating sequence—on z/OS typically EBCDIC ordering where space and punctuation sort before letters depending on code page. Beginners confuse < with assignment or treat alphabetic compare as case-insensitive English sorting without verifying site rules. This page teaches syntax, LT equivalence, field-to-field limits, interaction with arithmetic in conditions, THRU contrast, sort-order assumptions, and testing patterns for limit-driven batch logic.

Progress0 of 0 lessons

Basic Syntax

Less than appears between operands in conditions: IF AGE < 18, IF BALANCE < 0, IF EFF-DATE < CUTOFF-DATE. Evaluates true when left operand orders before right. False when equal or greater. Use inside IF ELSE-IF DO WHILE blocks.

text
1
2
3
4
5
6
7
8
JOB INPUT PAYROLL IF GROSS < MIN-WAGE PRINT UNDERPAY-RPT END-IF IF HOURS < STD-HOURS PRINT PART-TIME-RPT END-IF

< Versus LT

Less than operator forms
FormExampleBoundary behavior
Symbolic <IF AMT < 100
Keyword LTIF AMT LT 100
Symbolic <=IF AMT <= 100
Keyword LEIF AMT LE 100

Numeric Less Than

Packed P 2 currency compares by monetary value: 99.99 < 100.00 is true. Negative numbers order below positive: IF BALANCE < 0 detects overdraft. IF TAX < FLOOR-TAX compares two fields—both must share compatible numeric types. Implied decimal alignment matters: P 2 value 1.50 < N 3 literal 200 compares converted values per product rules—test edge cases in development. Zero boundary: IF COUNT < 1 triggers when COUNT is zero but not when COUNT is one.

Alphabetic Less Than and Collating

IF LAST-NAME < M selects names collating before letter M in the active sequence. EBCDIC differs from ASCII ordering—portable assumptions fail across platforms. Punctuation and spaces sort relative to letters per code page—IF CODE < 0 may treat digit zero differently than alphabetic A depending on type. Fixed-length fields compare full width including trailing spaces—shorter effective names still carry blanks that influence order. Case: lowercase versus uppercase position depends on collating table.

Field-to-Field Thresholds

IF ACTUAL < BUDGET flags underspend. IF CURR-DATE < EXPIRE-DATE finds active records when dates stored in comparable internal formats—see internal date representation page when FILE dates use special packed layouts. IF SALES < QUOTA drives commission exception lists. Both operands should represent same unit—comparing hours to dollars with < is a logic bug even when compiler accepts types.

text
1
2
3
4
5
6
DEFINE MIN-WAGE W 5 P 2 VALUE 7.25 JOB INPUT PAYROLL IF GROSS < MIN-WAGE PRINT WAGE-EXCEPTION END-IF

Less Than With Arithmetic

IF REG-HRS + OT-HRS < STD-HRS sums before compare—addition binds tighter than < per order of evaluation. IF (BASE + BONUS) < CAP groups subexpression. IF A < B + C evaluates right side sum first. Parentheses document intent for auditors reading procedural code during compliance reviews.

Open Ranges Versus THRU

IF AGE < 18 selects everyone below eighteen with no lower bound stated—includes zero and negatives if present. IF AGE EQ 13 THRU 17 selects closed interval. Combine for band gaps: IF AGE LT 13 OR AGE GT 17 handles outside teen band. Business rules written as under eighteen map directly to < 18; rules saying eighteen and under need <= 18.

Less Than Versus Not Equal

IF STATUS <> A includes all statuses ordering after A and before A in collating sequence—not the same as IF STATUS < A which includes only values strictly before A. Numeric IF AMT <> 100 includes amounts above and below hundred; IF AMT < 100 only below. Pick operator matching policy language precisely.

Sort Order and Control Breaks

Less than in IF does not require sorted input. Reports using CONTROL breaks need sorted keys but that is separate from < threshold tests. When IF KEY < PRIOR-KEY detects sequence violations, input should be ascending by KEY—validation pattern for file quality checks.

Common Less Than Mistakes

  • Using < when business rule includes equals—should be <=.
  • Assuming ASCII collating on EBCDIC files for alphabetic tests.
  • Comparing dates in display format without internal representation alignment.
  • Chaining IF A < B < C without verifying grammar support.
  • Mixing < and LT randomly in one program.
  • Threshold literals with wrong implied decimal scale.

Explain It Like I'm Five

Less than means comes before on a number line or in the dictionary order the computer uses. Five is less than ten, so five stands to the left of ten. If the rule says kids under eighteen, the computer checks is your age number smaller than eighteen? Exactly eighteen is not smaller—it is equal—so strict less than says no unless the rule says eighteen or younger, which uses a different sign. Letters have an order too—whether A comes before B depends on the computer alphabet list for your mainframe.

Exercises

  1. Write IF GROSS < 1000 exception filter with PRINT.
  2. Explain strict < versus <= for passing grade 60.
  3. Write IF HRS + OT < 40 with parentheses optional variant.
  4. Describe EBCDIC impact on IF CODE < M for alphabetic CODE.
  5. Rewrite IF AMT LT 50 using symbolic < only.

Quiz

Test Your Knowledge

1. IF AGE < 18 means:

  • AGE is less than 18
  • AGE equals 18
  • Assign 18 to AGE
  • AGE is at least 18

2. LT is:

  • Keyword less than
  • Literal type
  • Link table
  • Long text

3. IF GROSS < LIMIT flags:

  • Pay below limit threshold
  • Pay above limit
  • Pay exactly at limit
  • Invalid pay only

4. Alphabetic IF CODE < M orders by:

  • Collating sequence
  • Numeric subtraction
  • Field length only
  • Random hash

5. IF A < B < C style chaining:

  • May need separate tests per Easytrieve grammar
  • Always valid as written
  • Only for assignment
  • JCL only
Published
Read time15 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 symbolic < less than in conditional expressionsSources: Broadcom Easytrieve 11.6 Language Reference relational operatorsApplies to: Easytrieve less than operator (<)