Easytrieve vs REXX

REXX is the mainframe's general-purpose scripting language—fast to write, interpreted, ideal for TSO automation and glue logic. Easytrieve is a compiled report generator built for formatted batch output. They solve different problems but appear in the same data centers, sometimes in the same job stream.

Progress0 of 0 lessons

Core Philosophical Difference

REXX prioritizes flexibility and immediacy. Easytrieve prioritizes structured report semantics—CONTROL, SUM, LINE, TITLE—and compiled performance for repeatable batch. REXX is the duct tape; Easytrieve is the printing press.

Easytrieve vs REXX
AspectEasytrieveREXX
Execution modelCompiled load moduleInterpreted script (exec)
Primary useBatch reports and extractsAutomation, parsing, prototyping
Report featuresBuilt-in CONTROL/SUM/TITLEManual loops and SAY/WRITE
Change cycleCompile after source editEdit exec and rerun
TSO integrationPossible online; not primaryNative under TSO/E
String handlingField-oriented recordsExcellent parse and string ops

When to Use REXX

  • ISPF CLIST/REXX tools to allocate datasets and submit jobs.
  • Parse SYSPRINT or job log output for error strings.
  • Prototype logic before committing to COBOL or Easytrieve.
  • Small file transforms where report formatting is trivial.
  • Dynamic JCL generation based on parameters or calendar rules.
  • Bridge between TSO commands and batch schedulers.

When to Use Easytrieve

  • Scheduled production reports with standard layout and totals.
  • Multi-break listings audited by finance or compliance.
  • Large sequential or VSAM files where compiled I/O performs better than interpreted loops.
  • Programs owned by report maintenance teams with Easytrieve standards.
  • SQL FILE reporting in Easytrieve Plus from Db2 tables.

Example: Same Simple Filter

REXX (conceptual batch fragment)

text
1
2
3
4
5
6
7
8
9
/* REXX - read file and print matching records */ numeric options fuzz 0 do while lines(infile) > 0 line = linein(infile) dept = substr(line, 21, 3) if dept = 100 then say substr(line, 1, 20) substr(line, 24, 7) end exit

Easytrieve

text
1
2
3
4
5
6
7
8
9
10
FILE INFILE NAME-FLD 1 20 A DEPT-FLD 21 3 N AMT-FLD 24 7 P 2 REPORT OUT LINE NAME-FLD AMT-FLD IF DEPT-FLD = 100 PRINT END-IF

For ten lines, REXX wins on speed of writing. For ten years of nightly production with control breaks and audit, Easytrieve wins on clarity and REPORT features.

Performance Considerations

Interpreted REXX loops incur overhead per record—acceptable for thousands of lines, painful for hundreds of millions without careful tuning or external sort preprocessing. Easytrieve generates machine code and uses runtime optimized for report I/O. Big file reporting belongs in Easytrieve (or COBOL/DFSORT pipelines), not raw REXX loops.

Working Together

Common pattern: REXX exec validates date parameters, allocates temporary datasets, submits a job with Easytrieve steps, and parses return codes from JES. Easytrieve does the heavy report; REXX orchestrates. Neither replaces the other in that design.

Explain It Like I'm Five

REXX is like sticky notes you write quickly to remind the computer to do small jobs. Easytrieve is like a formal letter template the computer fills in every night. Sticky notes are great for quick fixes; the template is better when the same letter must look identical for auditors every month.

Exercises

  1. Write three tasks for REXX and three for Easytrieve in your shop.
  2. Explain why interpreted REXX slows on huge files.
  3. Design a job where REXX submits an Easytrieve step.
  4. When would you prototype in REXX then rewrite in Easytrieve?
  5. Compare error handling: REXX SIGNAL vs Easytrieve runtime messages.

Quiz

Test Your Knowledge

1. REXX on z/OS is typically:

  • Compiled to load modules only
  • Interpreted at run time
  • Only for CICS
  • A sort utility

2. REXX excels at:

  • Multi-page control-break reports with standard headings
  • TSO automation, parsing, and glue scripts
  • VSAM cluster definition
  • Db2 table creation only

3. Easytrieve is usually better for:

  • Editing ISPF datasets interactively
  • Production batch reports run nightly for years
  • One-line command aliases
  • IPLing the system

4. Batch REXX runs from JCL with:

  • PGM=EZTPA00
  • PGM=IKJEFT01 or IRXJCL patterns
  • PGM=SORT only
  • PGM=IDCAMS only

5. A hybrid approach uses REXX to:

  • Replace all Easytrieve reports
  • Allocate datasets, set variables, and invoke compiled Easytrieve programs
  • Compile Easytrieve source automatically without JCL
  • Disable JCL
Published
Read time9 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: IBM REXX documentation and Broadcom Easytrieve TechDocsSources: IBM TSO/E REXX reference, Broadcom Application Guide, TSO/ISPF tutorialsApplies to: z/OS TSO, batch REXX, and Easytrieve batch