Detail lines are the body of every Easytrieve report—employee number, gross pay, department code aligned under TITLE headings. LINE statement declares column layout; report writer formats each selected record. AFTER-LINE is the report PROC hook firing immediately after each detail line prints—per-row logic that LINE static definition cannot express: increment audit sequence, print conditional footnote line when flag set, reset row-level edit field, or DISPLAY trace during development. BEFORE-LINE runs before the line; AFTER-LINE runs after—together they bracket detail output like bookends. Neither is PERFORMed from JOB. Both require END-PROC and placement directly after REPORT subactivity. Beginners put row filtering in AFTER-LINE when REPORT-INPUT or BEFORE-LINE is correct phase—line already on spool cannot be unsaid. This page teaches AFTER-LINE timing, practical use cases, interaction with CONTROL breaks, line counter patterns, restrictions on I/O, contrast with SUM and ADD, and testing with small PRINT samples.
PRINT selects record. REPORT-INPUT may reject or modify. BEFORE-LINE adjusts fields or skips via SELECT inside PROC per grammar. LINE formats columns to report stream. AFTER-LINE executes post-print row logic. Control break events may interrupt sequence when CONTROL field changes—AFTER-LINE still per detail row within group. TERMINATION PROC once at report end.
| PROC name | How often runs |
|---|---|
| BEFORE-LINE | Once per detail line before print |
| AFTER-LINE | Once per detail line after print |
| BEFORE-BREAK | When control field changes—before new group |
| AFTER-BREAK | After break totals for prior group |
12345678910REPORT PAY-RPT TITLE 'PAYROLL DETAIL' LINE EMP-NO GROSS DEPT AFTER-LINE. PROC ADD 1 TO DETAIL-SEQ IF WARN-FLAG EQ Y LINE WARN-MSG END-IF END-PROC
DETAIL-SEQ increments every printed row—useful for audit FILE PUT mirroring sequence. WARN-MSG second LINE prints only when flag set—conditional supplemental row after main detail.
BEFORE-LINE masks sensitive field before print—SSN partial hide. AFTER-LINE logs sequence after visible line printed. Order guarantees BEFORE runs before formatter sees data; AFTER runs when line already committed to spool—plan audit accordingly.
Extra LINE inside AFTER-LINE consumes vertical space toward page break—may trigger ENDPAGE sooner than static layout expects. LINESIZE width still applies—long WARN-MSG wraps. Count supplemental lines when estimating lines per page for ops printer setup.
Changing fields in AFTER-LINE affects next record if not reset—clear WARN-FLAG each iteration in JOB or start of REPORT-INPUT. Mutating GROSS in AFTER-LINE does not change line already printed but may corrupt SUM if writer reads field again—avoid unless documented behavior understood.
Each detail line is one row in your report table. AFTER-LINE is what you do right after finishing one row—like putting a check mark in your notebook counting how many rows you drew. BEFORE-LINE is what you do before drawing the row—like picking the right color crayon.
1. AFTER-LINE PROC runs:
2. AFTER-LINE is invoked by:
3. Use AFTER-LINE to:
4. AFTER-LINE versus AFTER-BREAK:
5. Report PROC placement for AFTER-LINE: