Easytrieve is a report generator and data management language used on IBM mainframes and, through Easytrieve Plus, on UNIX, Linux, and Windows. It lets you read files, filter and calculate on records, and print formatted reports using concise, English-like statements instead of the verbose structure required by COBOL or PL/I.
Formally, Easytrieve is a fourth-generation language (4GL) oriented toward report generation and file-oriented data processing. Where COBOL gives you fine-grained control over every paragraph and division, Easytrieve gives you high-level statements such as FILE, REPORT, SORT, and IF that describe what you want rather than every mechanical step of how to do it.
A typical Easytrieve program defines its files and fields in a Library section, specifies processing in an Activity section, and describes printed output in a Report section. When you compile the source, the Easytrieve compiler generates object code. After linking, you run the load module from JCL in batch or from an online environment that supports Easytrieve execution.
The product name today is CA Easytrieve Report Generator, published by Broadcom. Version 11.6 is the current documentation release and includes enhancements for SQL file access, environment-independent FILE statements, boundary checking, and integration with modern development tooling.
Organizations reach for Easytrieve when the job is primarily about data in files and information on paper or tape—not about updating a complex online transaction system. Common uses include:
Easytrieve is not a replacement for a relational database engine. It can read SQL tables through SQL FILE statements in Easytrieve Plus, but its strength remains record-oriented file processing and printed report layout.
On z/OS, an Easytrieve batch job looks like any other batch step. JCL provides DD statements for input files, output files, SYSPRINT for compiler or runtime messages, and sometimes SYSLMOD or STEPLIB for the Easytrieve runtime libraries. Your program source lives in a partitioned dataset member or sequential file. You compile with the Easytrieve compiler, link-edit the object, and execute with a standard EXEC PGM= step pointing at your load module.
Easytrieve sits above access methods (QSAM, BSAM, VSAM, and SQL interfaces) and below the business user who reads the report. The language handles record buffering, page headings, control breaks, and totals so you do not code them line by line as you would in COBOL REPORT SECTION syntax.
Understanding Easytrieve starts with its program structure. Most programs use some or all of these sections:
| Section | Purpose | Typical contents |
|---|---|---|
| LIBRARY | Declare files, fields, working storage, procedures | FILE statements, field definitions, W fields, PROC names |
| ACTIVITY | Processing logic—read, compute, branch | JOB, SORT, IF/ELSE, PERFORM, READ loops |
| REPORT | Formatted printed output | REPORT name, LINE, CONTROL, SUM, TITLE |
| SCREEN | Online terminal panels | SCREEN definitions, display and accept fields |
A minimal batch report might use only LIBRARY and REPORT. A file-to-file extract adds ACTIVITY logic. Online programs add SCREEN. The compiler processes sections in a defined order and checks that fields referenced in Activity or Report were declared in Library.
Beginners often ask how Easytrieve compares to COBOL, DFSORT, REXX, SAS, and SQL. Each tool has a sweet spot:
| Tool | Best for | Easytrieve advantage |
|---|---|---|
| COBOL | Complex business applications, CICS, large modular systems | Faster report development; less code for file summaries |
| DFSORT | High-volume sort, merge, copy, join without a compiled program | Control breaks, headings, and calculated fields in one program |
| REXX | Glue scripts, TSO automation, quick parsing | Structured report layout and built-in total logic |
| SAS | Statistical analysis and advanced analytics | Native z/OS batch integration; lighter for simple extracts |
| SQL / Db2 | Relational queries across normalized tables | Flat-file and legacy sequential workflows; Easytrieve Plus can also read SQL files |
The following simplified program reads a sequential employee file and prints name and salary for records where the department code equals 100. Line numbers are shown for teaching only; your shop may use different column rules.
12345678910FILE EMPFILE EMP-NAME 1 20 A EMP-DEPT 21 3 N EMP-SALARY 24 7 P 2 REPORT OUTPUT LINE EMP-NAME EMP-SALARY IF EMP-DEPT = 100 PRINT END-IF
The FILE statement names EMPFILE and defines fields by start position, length, and type (A for alphanumeric, N for numeric, P for packed decimal with decimals). The REPORT section names the output report, defines a detail line layout, and uses IF to select records. This is far shorter than equivalent COBOL for the same task.
Batch is the most common mode. A JCL job compiles or executes the program. Input files arrive on DD statements matching FILE names in the Library section. Output goes to SYSOUT, a sequential dataset, or a spool class. Batch jobs run on a schedule—nightly, month-end, or on demand—and produce large volumes of paper or flat files.
Easytrieve also supports online execution through screen-driven programs. The SCREEN section defines panels; the runtime displays fields and accepts user input. Online Easytrieve is less common today than batch reporting but remains in production at sites that built inquiry systems before widespread CICS or web front ends.
After compilation, open the compiler listing on SYSPRINT. Look for these sections:
If compilation fails, the message usually names the line and the undefined field or invalid statement. Fix the Library declaration first—most beginner errors are fields used before they are defined.
Imagine a stack of index cards where each card holds one person's name, team, and allowance money. Easytrieve is a helper that reads every card, picks only the cards for Team Red, copies the name and allowance onto clean sheets of paper in neat rows, and adds up the allowance at the bottom. You tell the helper where on each card to find the name and numbers, which team to keep, and how the paper should look. The helper does the boring copying and math so you do not have to write a long instruction book.
1. What is the primary purpose of Easytrieve?
2. Which company currently owns Easytrieve?
3. Which section of an Easytrieve program defines input and output files?
4. Easytrieve programs are typically compiled into what before execution?
5. Which environment is Easytrieve most commonly associated with?