Easytrieve AFTER-BREAK

Control breaks split reports into department sections, region subtotals, and account groupings. SUM prints subtotal amounts when CONTROL field value changes. AFTER-BREAK is the report PROC hook that runs immediately after the report writer finishes break processing for the prior group—after subtotals landed, before detail for the next group continues or before final grand totals depending on event order documented for your release. Use AFTER-BREAK to print dashed separator lines, audit messages, reset working flags, or apply formatting SUM cannot express. It is not PERFORMed from JOB logic—the report engine calls it by reserved name exactly like BEFORE-BREAK and AFTER-LINE. Placement immediately after REPORT subactivity is mandatory; mixing among job PROCs causes compile errors. Beginners enable CONTROL on unsorted files and debug AFTER-BREAK when root cause is input order. This page teaches AFTER-BREAK timing in report lifecycle, pairing with CONTROL and SUM, contrast with BEFORE-BREAK, allowed statements inside PROC, side effects on fields referenced by LINE, and testing with small sorted samples.

Progress0 of 0 lessons

Report Lifecycle and AFTER-BREAK Timing

PRINT selects record for report. REPORT-INPUT PROC may filter further. Detail LINE prints for each record. When CONTROL field changes, BEFORE-BREAK may print heading for new group. Break subtotals from SUM emit. AFTER-BREAK PROC runs post-break—ideal for trailing dashes, blank line, or resetting break-level edit flags. Sequence exact order consult Language Reference—do not assume BEFORE always before SUM without verifying release.

Report event order (typical)
Event PROCTypical timing
REPORT-INPUTPer selected record before detail
BEFORE-LINEBefore each detail line
AFTER-LINEAfter each detail line
BEFORE-BREAKBefore new control group output
AFTER-BREAKAfter control break totals for prior group
TERMINATIONReport completion

AFTER-BREAK PROC Skeleton

text
1
2
3
4
5
6
7
8
9
10
REPORT DEPT-RPT CONTROL DEPT SUM GROSS TITLE 'DEPARTMENT PAYROLL' LINE EMP-NO GROSS DEPT AFTER-BREAK. PROC SEP-LINE = '------------------------' LINE SEP-LINE END-PROC

CONTROL SUM and AFTER-BREAK Together

CONTROL DEPT declares break field. SUM GROSS accumulates per DEPT group. AFTER-BREAK adds presentation logic SUM does not cover—optional footnote LINE with literal text, DISPLAY to SYSPRINT for debug during development only. Do not re-SUM in AFTER-BREAK unless intentional double-count for audit—SUM already updated break totals.

Sort Order Requirement

Input must be sorted on CONTROL field—or report must SORT internally when grammar supports SORT before report phase. Unsorted DEPT values produce break on every row change back and forth—AFTER-BREAK fires constantly with meaningless subtotals. Verify sort keys match CONTROL field type and collating sequence.

AFTER-BREAK Versus BEFORE-BREAK

BEFORE-BREAK prints new department banner before detail lines of new group. AFTER-BREAK cleans up after prior group totals printed. Some layouts need only one; some need both— banner before, separator after. Test spool output with two departments and three employees each to see event order visually.

Allowed Logic Inside AFTER-BREAK

MOVE, assignment, MASK, additional LINE via fields, conditional IF on break level flags. Avoid heavy file I/O restricted by manual. Side effect: changing field AFTER-BREAK uses on next detail LINE affects subsequent rows—document mutations. Keep AFTER-BREAK short for maintainability.

Placement Rules

  • Report PROCs immediately follow REPORT subactivity block.
  • Do not interleave job PROCs between REPORT and its AFTER-BREAK.
  • END-PROC required to close module.
  • Label spelling AFTER-BREAK exact—typos become undefined user PROC.

Common AFTER-BREAK Mistakes

  • Unsorted input breaking CONTROL logic.
  • PERFORM AFTER-BREAK from JOB—wrong invocation model.
  • Report PROC after wrong REPORT name in multi-report job.
  • Double counting by ADD in AFTER-BREAK plus SUM.
  • Expecting AFTER-BREAK without CONTROL and PRINT activity.
  • Long I/O in PROC causing report writer restrictions or abend.

Explain It Like I'm Five

A control break is when the report starts a new section because the department name changed. AFTER-BREAK is what you do right after finishing the math for the old section— like drawing a line under the subtotal before starting the next department. The report machine calls AFTER-BREAK for you when it notices the department changed.

Exercises

  1. Write REPORT with CONTROL SUM and empty AFTER-BREAK PROC skeleton.
  2. Explain sort requirement for CONTROL DEPT.
  3. Contrast AFTER-BREAK with BEFORE-BREAK use cases.
  4. Describe where AFTER-BREAK PROC must appear in source file.
  5. List one side effect risk when modifying fields in AFTER-BREAK.

Quiz

Test Your Knowledge

1. AFTER-BREAK is:

  • Report PROC invoked after control break processing
  • Library FILE statement
  • JCL DD
  • Sort verb

2. AFTER-BREAK PROC must be placed:

  • Immediately after REPORT subactivity that uses it
  • Before PARM
  • In JCL
  • Before FILE

3. CONTROL on DEPT field with AFTER-BREAK typically needs:

  • Input sorted by DEPT
  • Unsorted random file
  • No PRINT
  • No LINE

4. AFTER-BREAK compared to BEFORE-BREAK:

  • AFTER runs after break totals; BEFORE runs before break output
  • Identical timing
  • BEFORE after totals
  • Neither uses PROC

5. PERFORM AFTER-BREAK manually:

  • Invalid—report writer invokes automatically
  • Required every line
  • JCL only
  • Compile directive
Published
Read time15 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 report PROC AFTER-BREAK eventSources: Broadcom Activity Section Reporting, Procedures report eventsApplies to: Easytrieve AFTER-BREAK report PROC