Easytrieve GT Operator

GT is the keyword spelling for greater than in Broadcom Language Reference relational tables. IF GROSS GT LIMIT flags high earners. IF HOURS GT 40 drives overtime review when strictly above forty matters. IF BALANCE GT 0 includes only positive accounts. Broadcom Getting Started filtered-report examples show IF GROSS GT 0 before PRINT to skip zero-pay lines—keyword form matches documentation headings beginners search. Strict GT excludes equality: IF AGE GT 65 passes sixty-six but fails when AGE is exactly sixty-five; use GE when policy says sixty-five and older. Symbolic > expresses the same ordering relation. Numeric GT compares magnitude with implied decimals. Alphabetic GT follows collating sequence. This page teaches GT syntax, equivalence with >, overtime and credit-cap patterns, field-to-field ceiling tests, contrast with GE, logical combinations, and boundary-value testing for threshold-driven Easytrieve batch jobs.

Progress0 of 0 lessons

GT in Conditional Expressions

GT appears in IF, ELSE-IF, DO WHILE, and nested conditions. IF AMOUNT GT 1000 selects large transactions. IF DATE GT CUTOFF processes post-change records. IF SCORE GT PASS-LEVEL identifies passing examinees when cutoff is strict above pass level—verify policy. True when left exceeds right; false when equal or less.

text
1
2
3
4
5
6
7
8
JOB INPUT PERSNL IF GROSS GT 0 PRINT PAY-RPT END-IF IF OT-HOURS GT 0 PRINT OVERTIME-RPT END-IF

GT Versus Symbolic >

Greater than operator forms
FormExampleAt equality
Keyword GTIF AMT GT 100
Symbolic >IF AMT > 100
Keyword GEIF AMT GE 100
Symbolic >=IF AMT >= 100

Strict GT Versus Inclusive GE

Overtime contracts stating over forty hours map to GT 40. Contracts stating forty hours and above map to GE 40—exactly forty must pass. Senior benefits at sixty-five and older use GE 65, not GT 65. Off-by-one errors from choosing GT when GE matches policy language are common audit findings. Write the business rule in comments when boundary semantics affect pay or compliance.

Numeric GT

IF GROSS GT 50000 selects high earners above fifty thousand at field scale. IF BALANCE GT CREDIT-LIMIT flags over-limit accounts. IF RATE GT MAX-RATE triggers compliance review. Negative numbers: IF LOSS GT -100 is true for -50 because -50 exceeds -100 on the number line. Compare packed fields at implied decimal—display edited pictures may differ from stored compare values.

Alphabetic GT

IF CODE GT M selects codes collating after M in EBCDIC. IF NAME GT JONES approximates directory ranges—not always intuitive English alphabet order. Trailing spaces affect ordering—padded names compare as longer strings. Use GT for open-ended upper splits when lower bound is handled separately with GE or EQ THRU.

text
1
2
3
4
5
6
7
8
JOB INPUT SALES IF REVENUE GT QUOTA PRINT STAR-PERFORMER END-IF IF DISCOUNT-PCT GT MAX-ALLOWED PRINT PRICING-EXCEPTION END-IF

Field-to-Field GT

IF ACTUAL GT BUDGET flags overspend. IF CURR-BAL GT PRIOR-BAL detects balance increases. IF EXP-DATE GT TODAY finds future expirations when date formats align. Type mismatch between numeric and alphabetic operands causes compile errors or false results—define working fields explicitly.

GT With THRU and Banded Logic

IF AGE GE 18 AND AGE LT 65 defines a working-age window—GT alone does not cap upper bound. IF SCORE GT 59 AND SCORE LT 90 defines a mid band excluding exact endpoints if strict on both sides. EQ THRU closed intervals differ from GT open lower bound—choose based on whether boundary values belong in the set.

GT in Logical Expressions

IF AMT GT 1000 AND REGION EQ E combines threshold with code filter. IF NOT AMT GT 100 expresses at-most-one-hundred—prefer LE 100. IF OUTLIER GT HIGH OR OUTLIER LT LOW catches both tails. Parentheses clarify mixed AND OR with GT.

GT in Report Filtering

Primary use is JOB logic before PRINT. IF GROSS GT 0 PRINT is the classic positive-pay filter. Exception reports combine GT with EQ NE: IF VARIANCE GT TOLERANCE AND STATUS EQ A. REPORT PROC relational use depends on release—confirm grammar outside JOB before coding GT in report-only contexts.

Testing GT Logic

  1. Test one below, at, and one above boundary values.
  2. Verify IF GROSS GT 0 excludes zero and negative pay.
  3. Compare GT versus GE at exact overtime hour boundary.
  4. Test field-to-field GT with known larger and smaller pairs.
  5. Validate negative number GT behavior on number line.

Common GT Mistakes

  • Using GT when policy means at least—should be GE.
  • Inverting GT and LT in limit checks.
  • IF GROSS GT 0 when zero-pay rows should appear on separate report—logic error.
  • Comparing incompatible date formats.
  • Mixing GT and > without team convention.
  • Assuming GT ignores trailing spaces on alphabetic fields.

Explain It Like I'm Five

GT means bigger than. If the sign says you must be taller than this line to ride, being exactly as tall as the line is not enough—you need to be above it. GT is the word for that strict bigger check. On the number line, five is GT three. Forty-one hours is GT forty, but exactly forty hours is not GT forty—that needs GE if forty counts too.

Exercises

  1. Write IF GROSS GT 0 PRINT using GT keyword only.
  2. Explain GT versus GE for overtime at exactly forty hours.
  3. Write IF REVENUE GT QUOTA star-performer filter.
  4. Combine GT lower and LT upper for a score band IF.
  5. Describe negative IF LOSS GT -100 behavior with example values.

Quiz

Test Your Knowledge

1. IF GROSS GT LIMIT means:

  • GROSS exceeds LIMIT
  • GROSS equals LIMIT
  • Assign LIMIT to GROSS
  • GROSS is below LIMIT

2. GT and symbolic > in IF HOURS GT 40 versus IF HOURS > 40:

  • Both express strict greater than
  • GT assigns and > compares
  • Only GT valid
  • Only > valid

3. IF HOURS GT 40 detects:

  • Hours strictly above forty
  • Exactly forty hours
  • Forty or more hours
  • Zero hours only

4. Broadcom sample IF GROSS GT 0 before PRINT:

  • Includes positive pay amounts only
  • Excludes all pay
  • Sorts the file
  • Defines FILE

5. IF A GT B compares:

  • Ordering of two values
  • String concatenation
  • Assignment
  • MOD remainder
Published
Read time15 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 GT keyword greater than in conditional expressionsSources: Broadcom Easytrieve Report Generator 11.6 Language Reference relational operatorsApplies to: Easytrieve GT operator in comparisons