Easytrieve LT Operator

LT is the keyword spelling for less than in Broadcom relational operator documentation. IF GROSS LT MIN-WAGE triggers underpay exception reports. IF ON-HAND LT REORDER-POINT drives replenishment lists. IF AGE LT 18 excludes adult-rate processing. Strict LT excludes equality: when SCORE is exactly sixty, IF SCORE LT 60 fails; use LE when policy includes the boundary. Symbolic < expresses the same ordering test; LT reads clearly on printed listings beside EQ NE GT GE LE. Numeric LT compares magnitude with implied decimals. Alphabetic LT uses collating sequence—on z/OS typically EBCDIC where spaces and punctuation order before letters depending on code page. Beginners invert LT and GT in limit checks or code LT when policy means at most—should be LE. This page teaches LT syntax, equivalence with <, field-to-field ceiling tests, date and amount thresholds, contrast with LE and THRU, logical combinations, and validation patterns for limit-driven Easytrieve batch jobs.

Progress0 of 0 lessons

LT in Conditional Expressions

LT appears between operands in IF, ELSE-IF, DO WHILE, and nested JOB logic. IF BALANCE LT 0 detects overdraft. IF EFF-DATE LT CUTOFF-DATE selects records before a policy change. IF HOURS LT STD-HOURS flags part-time schedules. True when left orders before right; false when equal or greater.

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

LT Versus Symbolic <

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

Strict LT Versus Inclusive LE

Labor rules often phrase at most sixty hours—map to LE 60, not LT 60, if exactly sixty must pass. Failing grades below sixty map to LT 60 when exactly sixty is passing—then use GE 60 for pass band. Misreading policy as strict LT when boundary belongs in the set causes off-by-one production bugs auditors catch months later. Document boundary intent beside the IF when compliance depends on it.

Numeric LT

Packed P 2 currency: 99.99 LT 100.00 is true. Negative numbers order below positive: IF BALANCE LT 0 detects overdraft. IF TAX LT 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 LT MAX-CAP enforces volume ceilings before further processing.

Alphabetic LT

IF CODE LT M includes codes collating before M in EBCDIC—often A through L ranges depending on literal and field definition. IF NAME LT SMITH selects names sorting before SMITH in directory order—not English dictionary case folding unless site rules say so. 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 LT REORDER-PT PRINT RESTOCK-RPT END-IF IF WHSE-CODE LT 'M' PRINT ZONE-A-RPT END-IF

Field-to-Field LT

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

LT With THRU and Banded Logic

Open-ended lower bands use LT alone: IF AGE LT 18 for minors. Closed bands combine operators: IF AGE GE 18 AND AGE LT 65 for working-age window. EQ THRU expresses inclusive ranges on the low side with upper cap—IF CODE EQ 1 THRU 5 differs from IF CODE LT 6 when code six should exclude. Choose LT for single open boundary; combine for windows.

LT in Logical Expressions

IF AMT LT 0 OR AMT GT 1000 flags outliers both tails. IF NOT AMT LT 100 expresses at-least-one-hundred logic—prefer GE 100 for readability. Parentheses clarify: IF (SCORE LT 60) AND (ATTEND GE 80). Chained IF A LT B LT C is not valid in most grammars—split into AND conditions.

Date and Time LT

When dates store as packed or character YYYYMMDD, LT compares chronologically if formats align. IF TRAN-DATE LT CUTOFF excludes on-or-after cutoff when strict LT—use LE with adjusted cutoff for inclusive end dates. Julian versus Gregorian layouts must match before LT tests mean what schedulers expect.

Testing LT Logic

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

Common LT Mistakes

  • Using LT when policy means at most—should be LE.
  • Inverting LT and GT in threshold checks.
  • Comparing dates in mismatched formats.
  • Assuming alphabetic LT ignores trailing spaces.
  • Chained relational expressions not supported—use AND.
  • Mixing LT and < without team convention.

Explain It Like I'm Five

LT means smaller than. If the rule is kids shorter than this line go on the small rides, you measure against the line. Exactly as tall as the line does not count for strict smaller—you need to be below it. LT is the word version of the less-than arrow. Numbers lower on the number line pass. Letters earlier in the computer alphabet pass before later ones.

Exercises

  1. Write IF GROSS LT MIN-WAGE PRINT using LT keyword only.
  2. Explain LT versus LE when minimum wage must include exact minimum pay.
  3. Write IF ON-HAND LT REORDER-PT restock filter.
  4. Split invalid chained compare into AND with LT.
  5. Describe EBCDIC impact on IF CODE LT M.

Quiz

Test Your Knowledge

1. IF AGE LT 18 means:

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

2. LT and symbolic < in IF GROSS LT LIMIT versus IF GROSS < LIMIT:

  • Both express strict less than
  • LT assigns and < compares
  • Only LT valid
  • Only < valid

3. IF GROSS LT MIN-WAGE flags:

  • Pay strictly below minimum
  • Pay at or above minimum
  • Pay exactly at minimum
  • Invalid pay only

4. IF CODE LT M orders alphabetic fields by:

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

5. IF SCORE LT 60 versus IF SCORE LE 59 at SCORE equals 59:

  • Both pass at 59
  • LT passes LE fails
  • Both fail
  • Compile error
Published
Read time15 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 LT keyword less than in conditional expressionsSources: Broadcom Easytrieve Report Generator 11.6 Language Reference relational operatorsApplies to: Easytrieve LT operator in comparisons