Easytrieve earned its name from reporting. The REPORT statement opens a report subactivity—a declarative layout block at the end of a JOB activity where you name the report, set line and page sizes, and code TITLE, LINE, CONTROL, and SUM statements. JOB logic elsewhere issues PRINT report-name when a record should appear; the report writer formats columns, headings, control breaks, and totals defined here. Beginners embed TITLE lines inside IF blocks or confuse REPORT with FILE; both fail compile. REPORT never reads files—it describes output. This page teaches REPORT header parameters, statement order inside the block, pairing with PRINT, multiple reports per JOB, LINESIZE and PAGESIZE effects, SEQUENCE behavior, and placement of BEFORE-LINE and other report PROCs immediately after the REPORT block. Master this before HEADING, FOOTING, and control-break tutorials in the reports chapter.
12345678REPORT report-name [LINESIZE n] [PAGESIZE n] [SEQUENCE] [other options] TITLE 'EMPLOYEE LISTING' 'RUN DATE' RUN-DATE LINE EMP-NO EMP-NAME DEPT SALARY BEFORE-LINE. PROC * optional detail hook END-PROC
Report-name is a unique identifier PRINT references. Parameters after the name are optional and may appear in orders documented for your release. TITLE and LINE statements follow inside the REPORT block. Report PROCs come after the last layout statement in the block, not inside TITLE.
| Parameter | What it does | Beginner tip |
|---|---|---|
| LINESIZE | Maximum characters per report line | Match SYSOUT LRECL and printer width |
| PAGESIZE | Lines per page before page break | Coordinate with HEADING and FOOTING |
| SEQUENCE | Detail ordering control | Use when sort order must match output |
| report-name | PRINT target name | Keep names short and unique per JOB |
Executable JOB body: JOB INPUT, IF, MOVE, PRINT. No TITLE or LINE there. REPORT subactivity at JOB end holds all layout. PRINT PAYROLL-RPT in logic selects records; REPORT PAYROLL-RPT defines columns. Changing layout edits REPORT only; changing who prints edits IF and PRINT only. Clean separation survives decades of maintenance.
12345678910JOB INPUT EMPFILE IF STATUS EQ 'A' PRINT ACTIVE-RPT END-IF REPORT ACTIVE-RPT LINESIZE 132 PAGESIZE 60 TITLE 'ACTIVE EMPLOYEES' 'PAGE' LINE EMP-NO NAME DEPT CONTROL DEPT SUM SALARY
TITLE declares heading lines—literals and fields at page or section tops. LINE declares detail columns printed when PRINT fires. CONTROL on a field triggers break processing when value changes—department subtotals, new headings per region. SUM accumulates numeric fields at control breaks and report end. All are children of REPORT, not separate activities. Nesting CONTROL fields creates hierarchical breaks; order in REPORT matters for break levels.
One JOB may declare REPORT SUMMARY-RPT and REPORT DETAIL-RPT. PRINT routes records to each. Summary and detail in same run share input file but different layouts. Each REPORT has its own TITLE, LINE, and report PROCs immediately following that block. Do not interleave two REPORT definitions—finish one including its PROCs before starting the next REPORT header.
BEFORE-LINE, AFTER-LINE, BEFORE-BREAK, AFTER-BREAK, TERMINATION, ENDPAGE—special-name PROCs hook report writer events. Broadcom requires them immediately after the REPORT subactivity they belong to. PERFORM does not invoke them; the writer calls them automatically. INVALID statements inside certain report PROCs are documented per hook—mirror BEFORE-SCREEN restrictions where applicable.
Reports usually target FILE SYSPRINT PRINTER or a named printer FILE. DD SYSOUT class in JCL routes spool output. LINESIZE 132 with SYSOUT LRECL 133 is a common shop standard. Mismatched LINESIZE causes truncation or wrap that misaligns columns—test with IDCAMS-free listing on development class.
This page is the REPORT statement reference. The report section overview page teaches broader report writer architecture. Statements TITLE, LINE, TOTAL, and reports chapter PRINT depth expand individual layout verbs named inside REPORT blocks.
REPORT is the template for a coloring page—the boxes where numbers and names go, the title at the top, and where to draw subtotal lines when the department changes. PRINT is pointing at a person and saying "put this row on the coloring page now." The template does not fetch people; the JOB part does and hands rows to PRINT.
1. REPORT subactivities belong:
2. PRINT in JOB logic:
3. LINESIZE on REPORT sets:
4. Report PROCs such as BEFORE-LINE must follow:
5. Multiple REPORT blocks in one JOB: