Easytrieve built its reputation on report generation. The report section—implemented as REPORT subactivities inside JOB activities—is where you declare titles, column layouts, control breaks, and subtotals. JOB logic decides which records matter; REPORT definitions decide how they look on paper or in spool output. Beginners often conflate PRINT with formatting, but PRINT only selects data. TITLE, LINE, CONTROL, and SUM statements in the report section do the layout work. This page teaches that separation and the statement order Broadcom requires for maintainable reports.
A REPORT subactivity is not a fourth top-level program section like Environment or Library. It lives inside a JOB activity after executable statements and any job PROCs. The compiler treats REPORT blocks as declarative: they describe report structure consumed by the report writer at runtime when PRINT fires or when automatic reporting options apply. Coding REPORT in the wrong place—before JOB INPUT or inside an IF—is a frequent compile error source.
1234567891011JOB INPUT PERSNL IF GROSS GT 0 PRINT PAY-RPT END-IF REPORT PAY-RPT LINESIZE 80 TITLE 01 'PAYROLL LISTING' TITLE 02 'EMPLOYEE DETAIL' LINE 01 EMPNO EMPNAME DEPT GROSS CONTROL DEPT SUM GROSS
PAY-RPT names the report and sets 80-column layout. Two TITLE lines form page headers. LINE 01 lists detail fields in print order. CONTROL DEPT starts a new control group when department changes, often printing break headers and subtotals. SUM GROSS accumulates gross pay within control groups and at report level depending on report writer options and additional SUM statements you code.
TITLE lines print at the top of pages or sections. You can mix literals in quotes with fields such as run dates if defined. Multiple TITLE levels stack vertically. Operations teams use titles to identify report purpose, run date, and environment in spool listings. Keep titles concise but informative—support staff searching SDSF for a failed cycle need recognizable text in the first TITLE line.
Each LINE defines one output row pattern for detail printing. Field names must exist in Library. The report writer applies default editing based on field type and any masks documented for your release. Column alignment depends on field lengths and LINESIZE. When columns overlap or truncate, verify field lengths and consider shorter aliases or edited derived fields in Library DEFINE.
| Statement | Role |
|---|---|
| REPORT name LINESIZE n | Names report and sets line width |
| TITLE nn text | Page or section headings |
| LINE nn fields... | Detail column layout |
| CONTROL field | Break when field value changes |
| SUM field | Subtotal or grand total numeric fields |
CONTROL fields segment the report. When DEPT changes from ACC to SAL, the report writer can print a break line, subtotal accumulated SUM fields, and start the next group. Multiple CONTROL fields create hierarchical breaks—region then department then team if coded. SUM designates which numeric fields aggregate at break levels. Misaligned CONTROL without SUM still breaks pages but may omit expected subtotals, confusing business reviewers.
SEQUENCE options documented for your release can order detail within breaks. Sorting input before the JOB so CONTROL fields change monotonically is essential—control breaks assume related records appear together. Running unsorted input through a broken report produces repeated break headers and incorrect subtotals even when source code is syntactically valid.
Complex jobs may PRINT to several reports: detail, exception-only, and summary audit. Define each REPORT subactivity with a unique name. JOB IF logic routes records to the appropriate PRINT target. Separate reports can route to different SYSOUT DD names through site conventions or report writer options. Document which report name maps to which DD for operations.
REPORT PROCs are procedures used within report processing—custom break lines, special formatting, or calculations at control points. Broadcom requires them immediately after the REPORT subactivity that references them, not mixed with job PROCs. Confusing job PROCs and REPORT PROCs causes compile errors about procedure placement or undefined report routines.
REPORT definitions describe content; JCL DD statements route the physical output stream. A report may default to SYSPRINT or a named DD depending on product options and PARM settings. Coordinate with operations so production JCL matches developer test JCL. A beautifully formatted report that routes to an unmonitored spool class still fails the business need if recipients never receive it.
JOB logic picks which photos go into the yearbook. The report section is the page template: title at the top, names in columns, a new section heading whenever the grade changes, and adding up how many students are in each grade. PRINT drops a photo on the page. TITLE and LINE tell the yearbook how that page should look. If photos arrive in random grade order, the section headings will keep popping up wrong—that is why sorting matters before control breaks.
1. REPORT subactivities are coded:
2. TITLE statements define:
3. LINE statements define:
4. CONTROL on a field typically:
5. REPORT PROCs must appear: