Easytrieve Reports Overview

Easytrieve earned its name as a report generator: read files, select rows, and print readable listings with titles, columns, and totals—without writing a full COBOL report section. A report in Easytrieve is not one statement. It is a partnership between JOB logic that decides which records matter and a REPORT subactivity that decides how those records look on paper or spool. PRINT schedules a record for the report writer. REPORT names the report and sets page width, spacing, and options. TITLE, HEADING, LINE, CONTROL, SUM, and SEQUENCE fill in page headers, column labels, detail layout, breaks, totals, and optional sort order. Beginners who only learn DISPLAY think reports are free-form dumps. Professionals treat the report writer as a layout engine that centers titles, pads columns, inserts page numbers, and prints department subtotals when DEPT changes. This overview maps the pieces, shows a complete beginner program, compares simple listings to control reports, explains the work-file idea behind deferred formatting, and points you to the dedicated PRINT, TITLE, HEADING, FOOTING, and LINE tutorials in this chapter.

Progress0 of 0 lessons

The Two Halves of Every Report

Half one is selection logic inside JOB. You open or automatically read input, test IF conditions, compute working-storage fields, and issue PRINT when a row should appear. Half two is the REPORT declaration at the end of the activity. It does not loop over the file itself—it formats every record PRINT already selected. Mixing the halves is the classic mistake: putting LINE fields in JOB without PRINT, or coding PRINT with no REPORT and LINE to consume it. Think of PRINT as dropping tickets into a hopper; REPORT is the machine that stamps tickets into a finished page.

Report building blocks
PieceRoleWhen it runs
JOB + PRINTSelect and schedule recordsPer input record in the activity loop
REPORTName report; set LINESIZE SPACE optionsDefinition; drives formatting pass
TITLEPage banner linesTop of each printed page
HEADINGColumn labelsUnder titles, above detail
LINEDetail field layoutEach scheduled record
CONTROL / SUMBreaks and totalsWhen control fields change or FINAL
SEQUENCEOrder work file before formatBefore detail formatting when coded

Minimal Report You Can Compile Mentally

text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
FILE PERSNL FB(150 1800) EMP# 9 5 N NAME 17 20 A DEPT 98 3 N GROSS 94 4 P 2 JOB INPUT PERSNL IF DEPT EQ 901 PRINT END-IF REPORT PAY-RPT LINESIZE 80 TITLE 01 'DEPARTMENT 901 PAY LIST' LINE 01 EMP# NAME GROSS

FILE and fields describe input. JOB INPUT walks every personnel record. IF keeps only department 901. PRINT with no name feeds the first (only) report. REPORT PAY-RPT sets an eighty-column page. TITLE 01 prints a banner—Easytrieve typically adds date and PAGE count unless NODATE or NOPAGE. LINE 01 places employee number, name, and gross in default spaced columns. That pattern—filter, PRINT, REPORT, TITLE, LINE—is the beginner baseline before control breaks or multiple reports.

Page Anatomy Top to Bottom

A printed page usually stacks these bands. Title area comes first: company name, report name, run date, page number. Blank TITLESKIP lines may separate titles from column headings. Heading rows label EMP#, NAME, GROSS so readers know each column. Detail LINE rows fill the body—one logical line group per PRINT, sometimes multi-line with LINE 01 and LINE 02. When CONTROL is active, summary lines appear after groups and again at FINAL for grand totals. Page footing concepts—bottom labels, continued markers, or custom after-page text—are covered on the FOOTING page; classic Easytrieve emphasizes titles and control totals more than free-form footers.

Simple Listing Versus Control Report

A simple listing prints every selected row the same way. A control report adds CONTROL DEPT (or multiple levels) so Easytrieve watches field changes. When DEPT changes from 100 to 200, the writer prints subtotals for department 100 before starting 200. Quantitative fields on LINE often total automatically; SUM can limit which amounts accumulate. SEQUENCE DEPT EMP# sorts the work file so breaks fire in the right order even if input arrived unsorted. Without correct order, breaks fire on every disorderly change and totals look random—order is part of report design, not an afterthought.

text
1
2
3
4
5
6
REPORT DEPT-RPT LINESIZE 132 SEQUENCE DEPT EMP# CONTROL DEPT TITLE 01 'PAYROLL BY DEPARTMENT' LINE 01 DEPT EMP# NAME GROSS SUM GROSS

SEQUENCE orders by department then employee. CONTROL DEPT creates a break level. SUM GROSS says only gross accumulates on summary lines. LINE still lists the detail columns. PRINT in JOB still selects which employees enter the work file—CONTROL does not replace IF filters.

REPORT Options Beginners Meet First

  • LINESIZE — printable width; titles center within this width by default.
  • SPACE — default blanks between LINE and TITLE items (often three).
  • PAGESIZE — lines per page before a new page starts.
  • NODATE / NOPAGE / SHORTDATE — control automatic TITLE 01 date and page text.
  • NOADJUST — left-justify instead of centering titles; often required before COL on LINE.
  • TITLESKIP — blank lines between last title and headings or detail.
  • FILE printer-name — route this report to a named PRINTER FILE.

Each option changes readability. Narrow LINESIZE truncates or wraps layouts. Large SPACE wastes width on sparse reports. NOADJUST helps column-aligned machine extracts. FILE separates audit reports from main listings when one JOB prints two REPORT declarations.

Deferred Formatting and the Work File

PRINT does not always write the final printer line at that instant. Easytrieve often copies needed field values to a report work file (Virtual File Manager). After selection (and after SEQUENCE sort if coded), the formatter reads the work file and applies TITLE, HEADING, LINE, and CONTROL. That is why DISPLAY for debugging shows immediately while PRINT output appears as a finished package. Very large reports may redirect work to a sequential FILE on REPORT for capacity. You rarely code the work-file layout yourself—the product builds it from LINE and related items.

Multiple Reports in One JOB

One activity can declare REPORT DETAIL and REPORT EXCEPT. PRINT DETAIL and PRINT EXCEPT send rows to different layouts—clean employees one way, error rows another. The first report may be unnamed; additional reports need names, and PRINT must name its target. Shared input with branched PRINT is cleaner than two full JOB passes when filters differ only slightly.

Reports Versus DISPLAY and PUT

DISPLAY writes an immediate unformatted line—great for counters, abend messages, and traces. PUT writes a file record for downstream systems. PRINT builds human-readable (or spool) reports with structure. Use PUT for extract feeds, PRINT for people, DISPLAY for operators watching the job. Mixing PRINT for extracts without LINE control often produces irregular spacing that parsers hate—prefer PUT FB layouts for interfaces.

Where Masks and Field HEADING Fit

DEFINE GROSS ... MASK '$$,$$$.99' HEADING 'GROSS PAY' attaches edit and default column title to the field. LINE GROSS then inherits MASK and HEADING unless the report overrides. Explicit report HEADING statements or chapter pages on masks go deeper; the overview point is that Library definitions feed report appearance, so fix MASK at the field when every report should look the same.

Common Beginner Mistakes

  • PRINT without any REPORT or LINE definition.
  • CONTROL fields without SEQUENCE or sorted input.
  • Confusing TITLE (page banner) with HEADING (column labels).
  • Expecting DISPLAY formatting features from PRINT.
  • Two reports but PRINT without the report-name.
  • LINESIZE too small for the LINE item list.

How to Study This Chapter

  1. Master PRINT selection rules next—what gets into the report.
  2. Learn TITLE for page banners and automatic date/page.
  3. Learn HEADING for column labels and field HEADING attributes.
  4. Learn LINE for detail layout, COL, and POS.
  5. Read FOOTING for bottom-of-page and summary footing ideas.
  6. Then advance to control breaks, totals, masks, and multiple reports.

Explain It Like I'm Five

Imagine a classroom printer. PRINT is the teacher saying which student papers go into the printer tray. REPORT is the printer settings: how wide the paper is and how much space between words. TITLE is the big label at the top of every page. HEADING is the little labels above each column like Name and Score. LINE is what gets written for each student paper. CONTROL is when the teacher pauses at the end of each table group to add up scores before starting the next table.

Exercises

  1. Sketch TITLE, HEADING, LINE, and CONTROL on a sample page layout.
  2. Write a filter IF plus PRINT plus REPORT with one LINE of three fields.
  3. Explain why SEQUENCE matters before CONTROL DEPT.
  4. List three REPORT options and what each changes visually.
  5. Contrast PRINT, DISPLAY, and PUT for a payroll extract job.

Quiz

Test Your Knowledge

1. Where does the REPORT declaration live in an Easytrieve program?

  • At the end of a JOB activity as a report subactivity
  • Only in the Library section before FILE
  • Only in JCL SYSOUT
  • Only inside SCREEN BEFORE-SCREEN

2. What statement selects which records appear on a report?

  • PRINT
  • TITLE
  • HEADING
  • PARM

3. Which statement defines detail column layout?

  • LINE
  • GET
  • OPEN
  • MACRO

4. CONTROL on a report causes:

  • Subtotals when a control field value changes
  • Immediate SYSPRINT DISPLAY
  • VSAM KEYS redefine
  • JCL SPACE increase

5. PRINT differs from DISPLAY because PRINT:

  • Defers formatting through the REPORT writer
  • Always writes one unformatted line immediately
  • Only works online
  • Replaces FILE DEFINE
Published
Read time18 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve Report Generator 11.6 report declaration and PRINT flowSources: Broadcom Easytrieve 11.6 Language Reference REPORT, PRINT, TITLE, LINE, CONTROLApplies to: Easytrieve batch report writing fundamentals