Easytrieve REPORT Statement

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.

Progress0 of 0 lessons

Statement Format

text
1
2
3
4
5
6
7
8
REPORT 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.

REPORT Parameters Explained

Common REPORT options
ParameterWhat it doesBeginner tip
LINESIZEMaximum characters per report lineMatch SYSOUT LRECL and printer width
PAGESIZELines per page before page breakCoordinate with HEADING and FOOTING
SEQUENCEDetail ordering controlUse when sort order must match output
report-namePRINT target nameKeep names short and unique per JOB

JOB and REPORT Separation

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.

text
1
2
3
4
5
6
7
8
9
10
JOB 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 LINE CONTROL and SUM Inside REPORT

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.

Multiple REPORT Blocks

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.

Report PROC Placement

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.

Printer FILE and SYSOUT

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.

REPORT Versus REPORT Section Tutorial

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.

Common REPORT Mistakes

  • REPORT coded before JOB executable logic ends.
  • TITLE or LINE in JOB body instead of REPORT block.
  • PRINT name does not match REPORT report-name.
  • Report PROC before REPORT header.
  • LINESIZE wider than spool record allows.
  • Expecting REPORT to read input file—it only defines output.

Explain It Like I'm Five

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.

Exercises

  1. Write JOB INPUT with PRINT and matching REPORT with TITLE and LINE.
  2. Add CONTROL and SUM on one field inside REPORT.
  3. Declare two REPORT blocks with different names and PRINT routing.
  4. Place BEFORE-LINE PROC after REPORT and list what may run inside it.
  5. Explain LINESIZE versus physical SYSOUT LRECL for your shop standard.

Quiz

Test Your Knowledge

1. REPORT subactivities belong:

  • At end of JOB activity after job logic
  • Before FILE
  • In JCL only
  • Inside PARM

2. PRINT in JOB logic:

  • Selects records for a named report
  • Defines column layout
  • Allocates DD
  • Compiles macros

3. LINESIZE on REPORT sets:

  • Logical line width for the report
  • File BLKSIZE
  • Sort key length
  • Key field size

4. Report PROCs such as BEFORE-LINE must follow:

  • Immediately after their REPORT subactivity
  • Before Environment
  • Inside FILE
  • STEPLIB

5. Multiple REPORT blocks in one JOB:

  • Are allowed with distinct report-names
  • Forbidden
  • Only one LINE total
  • Requires SORT
Published
Read time16 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 REPORT subactivitySources: Broadcom Easytrieve 11.6 Language Reference REPORT, TITLE, LINE, Report ProceduresApplies to: Easytrieve REPORT statement in JOB activities