Easytrieve Report Section

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.

Progress0 of 0 lessons

REPORT Subactivities in Context

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.

Basic REPORT Skeleton

text
1
2
3
4
5
6
7
8
9
10
11
JOB 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 Statements

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.

LINE Statements and Columns

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.

Report layout elements
StatementRole
REPORT name LINESIZE nNames report and sets line width
TITLE nn textPage or section headings
LINE nn fields...Detail column layout
CONTROL fieldBreak when field value changes
SUM fieldSubtotal or grand total numeric fields

Control Breaks and Summaries

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.

Multiple Reports in One JOB

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

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.

Output Routing and JCL

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.

Testing Reports

  1. Run with a small known input file and verify column alignment.
  2. Confirm CONTROL breaks appear only when sort order supports them.
  3. Compare SUM totals against manual calculations or SQL aggregates.
  4. Check TITLE text and page breaks at LINESIZE boundaries.
  5. Verify empty input produces acceptable headers or documented empty-report behavior.

Common Report Mistakes

  • Coding REPORT before JOB executable logic completes.
  • Expecting formatting from PRINT without LINE definitions.
  • CONTROL on unsorted input files.
  • Field names on LINE not defined in Library.
  • REPORT PROCs placed after the wrong REPORT or among job PROCs.

Explain It Like I'm Five

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.

Exercises

  1. Write a REPORT with two TITLE lines, one LINE, CONTROL on DEPT, and SUM on GROSS.
  2. Explain why input should be sorted before CONTROL DEPT.
  3. Add a second REPORT for exception records with a different TITLE.
  4. Describe where REPORT PROCs must be placed relative to job PROCs.
  5. List three tests you would run before promoting a new payroll report.

Quiz

Test Your Knowledge

1. REPORT subactivities are coded:

  • At the end of a JOB activity
  • Before FILE statements
  • In JCL only
  • Inside Environment PARM

2. TITLE statements define:

  • Report headings and page header lines
  • JCL job names
  • Sort keys
  • File DCB values

3. LINE statements define:

  • Detail column layout for report rows
  • Library field positions
  • STEPLIB concatenation
  • Screen input maps

4. CONTROL on a field typically:

  • Triggers control breaks and subtotals when the field value changes
  • Closes the file
  • Compiles the program
  • Sets JCL class

5. REPORT PROCs must appear:

  • Immediately after the REPORT subactivity that uses them
  • Before PARM
  • In the linker input
  • Only in SCREEN activities
Published
Read time12 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 REPORT subactivity, TITLE, LINE, CONTROL, and SUM patternsSources: Broadcom Easytrieve Report Generator 11.6 TechDocs, Activity Section - ReportingApplies to: Easytrieve batch report definition and formatting