Easytrieve Report Page Numbers

Page 1 on every sheet is a classic beginner bug—TITLE 03 'PAGE 1' looks fine in development until page two arrives in production with the same digit. Page numbers are dynamic report writer state, not literals frozen at compile time. As PRINT feeds records, the writer tracks how many lines TITLE headings, detail groups, SKIP gaps, and subtotals consumed on the current page. When PAGESIZE line budget exhausts, the writer ejects to a new page, reprints TITLE headings, and increments the page counter you reference in TITLE through a report function or system field exposed for pagination. CONTROL RENUM goes further—after a major break the next page not only ejects but restarts numbering at 1 so each region packet reads Page 1 of its section. Beginners tune detail without watching TITLE block height and wonder why pagination looks random; veterans calculate lines per employee group plus headings against PAGESIZE 58 or 60. This page teaches PAGESIZE versus LINESIZE, embedding page values in TITLE, RENUM interaction, report functions index cross-reference, and testing pagination on multi-page control reports.

Progress0 of 0 lessons

Pagination Parameters

text
1
2
3
4
5
6
REPORT PAY-RPT LINESIZE 132 PAGESIZE 60 TITLESKIP 2 TITLE 01 'ACME PAYROLL REGISTER' TITLE 02 'RUN DATE' RUN-DATE TITLE 03 'PAGE' + PAGE-FIELD LINE 01 EMPNO EMPNAME GROSS CONTROL DEPT

PAGESIZE sets lines per page; LINESIZE sets characters per line. PAGE-FIELD represents a working storage field assigned from report page function in TITLE processing or BEFORE-LINE—exact function name varies by release; consult report functions index and verify on your compiler listing. Pattern: literal PAGE plus dynamic field beats embedding static numbers.

PAGESIZE Line Budget

What consumes PAGESIZE lines
ConsumerTypical line cost
Each TITLE row1 per TITLE statement
TITLESKIPN blank lines after TITLE block
LINE group heightCount of LINE 01, 02, ... in group
SKIP after groupREPORT SKIP value
Control subtotal linesPer break level printed
CONTROLSKIPAfter subtotal before detail

Report Page Functions

Report functions chapter documents routines returning current page number and sometimes line number within page—use in TITLE, LINE, BEFORE-LINE, BEFORE-BREAK when pagination-aware logic is needed. Assign function result to W-type field in report procedure then reference field on TITLE for formatting with MASK. Do not call report functions expecting meaningful values in JOB body before first PRINT to that report—writer context may not exist yet.

TITLE Page Number Patterns

Right-aligned page number: TITLE 03 RUN-DATE left literals, page field right via spacing literals or padded assignment in INIT-REPORT procedure. Page X of Y requires both page and total-pages functions if release provides total page estimate—some releases approximate; verify whether total pages is known only after report completes. Operational reports often settle on Page N only.

CONTROL RENUM Reset

text
1
2
3
4
5
6
REPORT REGION-RPT PAGESIZE 58 TITLE 01 'REGIONAL PAYROLL' TITLE 02 'REGION' REGION-NAME ' PAGE' PAGE-FIELD LINE 01 EMPNO GROSS CONTROL REGION RENUM DEPT SUM GROSS

When REGION changes, RENUM on REGION ejects and sets next page number to 1. DEPT breaks within region continue incrementing page numbers until next region. Distribution teams mailing each region separately appreciate RENUM—each envelope starts at Page 1. Without RENUM, page numbers continue monotonically across regions—fine for single bound volume, confusing for per-region packets.

NEWPAGE Without RENUM

CONTROL NEWPAGE alone starts fresh page after break but preserves ascending page count—page 47 follows page 46 after region break. Choose NEWPAGE when visual separation matters but global page index must remain for legal exhibit numbering.

Testing Pagination

  1. Reduce PAGESIZE to 15 in test—force multiple pages with few detail records.
  2. Verify TITLE 03 page field increments on page 2 and 3.
  3. Trigger REGION RENUM—confirm next region shows Page 1.
  4. Add TITLE lines and observe earlier eject—heading height matters.
  5. Compare SKIP 2 versus SKIP 0 effect on page breaks per hundred records.

Common Page Number Mistakes

  • Literal Page 1 in TITLE on all pages.
  • Ignoring TITLE block height in PAGESIZE planning.
  • RENUM on low-level DEPT—unwanted restart every department.
  • Page function in JOB logic before PRINT—stale or zero values.
  • PAGESIZE incompatible with printer—operations override causes wrap.

Explain It Like I'm Five

Page numbers are the page corner on your coloring book. The report robot draws pictures until the page is full, then flips to a new sheet and writes the next number in the corner. If you glue Page 1 sticker on every sheet yourself, every page lies. RENUM is starting the corner numbers over at 1 when you begin a brand-new chapter book inside the same binder.

Exercises

  1. Write TITLE with literal PAGE plus placeholder field for dynamic number.
  2. Explain PAGESIZE versus LINESIZE in one sentence each.
  3. When use RENUM versus NEWPAGE only?
  4. List four line consumers that trigger page eject.
  5. Describe bug when TITLE says Page 1 on page 5.

Quiz

Test Your Knowledge

1. Page numbers in TITLE typically use:

  • Report writer page function or system page field
  • SORT key
  • FILE DCB
  • MACRO name

2. PAGESIZE on REPORT sets:

  • Lines per page before pagination eject
  • Record length
  • Block size
  • SQL fetch size

3. CONTROL field RENUM:

  • NEWPAGE plus reset page number to 1
  • Delete records
  • Skip sort
  • Close file

4. Hard-coding Page 1 in every TITLE causes:

  • Same page number on all pages
  • Automatic increment
  • Compile error
  • SORT failure

5. Page numbers advance when:

  • Report writer fills PAGESIZE and ejects
  • JOB starts
  • FILE opens
  • END-PROC runs
Published
Read time16 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 REPORT PAGESIZE, CONTROL RENUM, report functionsSources: Broadcom Easytrieve 11.6 REPORT Statement, CONTROL Statement, Report FunctionsApplies to: Easytrieve report pagination and page numbers