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.
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.
| Aspect | Easytrieve | REXX |
|---|---|---|
| Execution model | Compiled load module | Interpreted script (exec) |
| Primary use | Batch reports and extracts | Automation, parsing, prototyping |
| Report features | Built-in CONTROL/SUM/TITLE | Manual loops and SAY/WRITE |
| Change cycle | Compile after source edit | Edit exec and rerun |
| TSO integration | Possible online; not primary | Native under TSO/E |
| String handling | Field-oriented records | Excellent parse and string ops |
123456789/* 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
12345678910FILE 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.
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.
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.
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.
1. REXX on z/OS is typically:
2. REXX excels at:
3. Easytrieve is usually better for:
4. Batch REXX runs from JCL with:
5. A hybrid approach uses REXX to: