Current line on a report page means how far down the sheet the writer has printed—line one under the headings, line twenty after a batch of employees, line fifty-eight when the page is almost full. Easytrieve tracks that vertical position through the reserved system field LINE-COUNT while PAGE-NUMBER tracks which page you are on. Together they answer where am I on this page and which page am I on—questions REPORT procedures need before forcing a footer, skipping detail, or printing a warning when only two lines remain. PAGESIZE sets the ceiling; LINE-COUNT climbs as TITLE lines, TITLESKIP blanks, detail LINE groups, SKIP spacing, and CONTROL headers consume budget. When LINE-COUNT meets the limit, the writer ejects, PAGE-NUMBER ticks up, and LINE-COUNT returns to the post-heading baseline on the fresh page. Beginners confuse current line with physical file record number or with LINESIZE horizontal width—this page focuses on vertical pagination. You reference LINE-COUNT; you do not DEFINE it. Compare LINE-NUMBER mentions in Symbols docs on your compiler before swapping names in production TITLE blocks.
Variables overview lists LINE-COUNT beside PAGE-NUMBER as product-provided report statistics. Reserved words syntax categorizes LINE-NUMBER alongside PAGE-NUMBER for formatting—installations may standardize on one spelling for line position. Treat both as read-only: the report writer updates them during PRINT. Manual ADD 1 TO LINE-COUNT fights the engine and desynchronizes pagination from TITLE reprints. Copy LINE-COUNT into WS-LINE-DISP only when MASK or concatenation needs a working storage buffer.
| Name | Measures | Example |
|---|---|---|
| LINE-COUNT | Current vertical line on page | Line 42 of 60 on page 3 |
| PAGE-NUMBER | Which page in report | Page 3 of register |
| LINESIZE | Horizontal columns per line | LINESIZE 132 |
| PAGESIZE | Max vertical lines per page | PAGESIZE 60 |
| FILE record number | Input file sequence | Not LINE-COUNT |
Each printed line class increments LINE-COUNT by the lines it consumes. A single LINE statement with one employee row usually adds one. Multi-line masks or stacked fields may add more. TITLE lines at page top add their count after each eject. TITLESKIP inserts blank lines that still count. SKIP 2 after detail adds two. CONTROL break headers before detail on a new group add height. ENDPAGE logic runs at boundary—reading LINE-COUNT there shows the page about to close. Testing with DISPLAY in REPORT PROC during development clarifies consumption on your report definition better than guessing from source layout alone.
1234567891011REPORT DEPT-RPT PAGESIZE 60 LINESIZE 132 TITLE 01 'DEPARTMENT LISTING' TITLE 02 'PAGE' PAGE-NUMBER LINE 01 DEPT EMPNO SALARY CONTROL DEPT BEFORE-LINE. PROC IF LINE-COUNT GT 55 DISPLAY 'NEAR PAGE BOTTOM' LINE-COUNT END-IF END-PROC
When LINE-COUNT plus the next line group would exceed PAGESIZE, the writer ejects: reprint TITLE, reset LINE-COUNT to post-heading position, increment PAGE-NUMBER, then print the deferred detail. Custom REPORT PROC that forces extra SKIP without checking LINE-COUNT can orphan headings at page bottom with one detail line stranded on the next page—classic ugly spool. Procedures overview examples use IF LINE-COUNT GT 55 before printing banded footers on sixty-line pages, reserving five lines for summary text.
BEFORE-LINE runs before each detail line formats—safe place to test LINE-COUNT against thresholds. AFTER-LINE sees the line already placed. ENDPAGE handles page tail. IF LINE-COUNT GT threshold might PERFORM a footer PROC or set a flag for NEXT detail to defer. Avoid infinite GOTO loops that reprint without advancing records. Combine with CONTROL breaks when department headers need minimum lines remaining—if LINE-COUNT GT 50 and break upcoming, early NEWPAGE may look cleaner than splitting header across pages.
Documentation cross-references LINE-NUMBER for formatting contexts similar to PAGE-NUMBER. Some release notes treat names interchangeably for report vertical index; others distinguish line sequence within detail group. Before migration, compile a one-page test report that DISPLAYs both if your Symbols table lists both—record results in shop standards. This tutorial standardizes on LINE-COUNT as the variables page does for teaching current line on page.
Report functions index describes line count routines returning lines on current page—functional style versus bare LINE-COUNT field. Teams pick one style for consistency in TITLE and PROC. Function argument lists may vary between Report Generator and Plus; system field names are often simpler for beginners reading declarative REPORT blocks.
SKIP after LINE inserts vertical whitespace that increments LINE-COUNT without new data fields. TITLESKIP after heading block adds leading blanks on every page including after eject. Designers who add SKIP 3 between every detail for readability burn PAGESIZE faster—PAGE-NUMBER rises and LINE-COUNT hits ceiling sooner. Tune SKIP when operations complain about excessive pages despite modest record counts.
Array access tutorials loop L-SUB LE INV-LINE-COUNT where LINE-COUNT comes from a file header field—that is a user or FILE field counting invoice lines inside a record, not the system LINE-COUNT report variable. Qualification and context disambiguate: bare LINE-COUNT in REPORT PROC is pagination; INV-LINE-COUNT on FILE is data. Teach new developers the two meanings explicitly during code review.
Current line is which row on your notebook page you are writing on—first row under the title, middle rows with sentences, almost at the bottom row. LINE-COUNT is the computer's finger pointing at that row number. PAGE-NUMBER is which page of the notebook. When the rows run out, you flip to a new page, the row finger goes back near the top after the title, and the page number goes up by one. You do not tap the row finger yourself—the writing robot does.
1. The primary system field for current line on a report page is:
2. LINE-COUNT resets when:
3. IF LINE-COUNT GT 55 in REPORT PROC might:
4. LINE-COUNT differs from PAGE-NUMBER because:
5. ADD 1 TO LINE-COUNT as user logic is: