Easytrieve Current Line (LINE-COUNT)

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.

Progress0 of 0 lessons

LINE-COUNT as System Field

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.

Vertical Position Versus LINESIZE

Line-related report concepts
NameMeasuresExample
LINE-COUNTCurrent vertical line on pageLine 42 of 60 on page 3
PAGE-NUMBERWhich page in reportPage 3 of register
LINESIZEHorizontal columns per lineLINESIZE 132
PAGESIZEMax vertical lines per pagePAGESIZE 60
FILE record numberInput file sequenceNot LINE-COUNT

How LINE-COUNT Advances

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.

text
1
2
3
4
5
6
7
8
9
10
11
REPORT 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

PAGESIZE and Page Eject

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.

LINE-COUNT in REPORT Procedures

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.

LINE-COUNT Versus LINE-NUMBER

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 Alternative

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 and TITLESKIP Interaction

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.

Not File Line Numbers

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.

Common Current Line Mistakes

  • Confusing LINE-COUNT with horizontal LINESIZE.
  • Manual ADD to system LINE-COUNT.
  • DEFINE LINE-COUNT user field colliding with system symbol.
  • Reading LINE-COUNT in JOB before PRINT starts.
  • Ignoring TITLE and CONTROL height when testing GT threshold.
  • Expecting LINE-COUNT to equal input record number.

Explain It Like I'm Five

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.

Exercises

  1. Write BEFORE-LINE IF LINE-COUNT GT 55 with DISPLAY for a PAGESIZE 60 report.
  2. Explain LINE-COUNT reset when page ejects.
  3. Contrast LINE-COUNT, PAGE-NUMBER, LINESIZE, and PAGESIZE in one sentence each.
  4. List three statement types that increment LINE-COUNT without detail data.
  5. Distinguish system LINE-COUNT from FILE invoice line count field.

Quiz

Test Your Knowledge

1. The primary system field for current line on a report page is:

  • LINE-COUNT
  • SYSDATE
  • FILE-STATUS
  • RETURN-CODE

2. LINE-COUNT resets when:

  • A new report page starts
  • JOB ends only
  • FILE closes
  • MACRO runs

3. IF LINE-COUNT GT 55 in REPORT PROC might:

  • Trigger custom logic before page fills
  • Sort the input file
  • Open a new DD
  • Compile the program

4. LINE-COUNT differs from PAGE-NUMBER because:

  • LINE-COUNT is vertical position on page; PAGE-NUMBER is page index
  • They are identical
  • LINE-COUNT is date
  • PAGE-NUMBER is file only

5. ADD 1 TO LINE-COUNT as user logic is:

  • Wrong—LINE-COUNT is system-maintained
  • Required every LINE
  • JCL standard
  • SCREEN only
Published
Read time15 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 LINE-COUNT report system fieldSources: Broadcom Easytrieve 11.6 Symbols, Variables, REPORT proceduresApplies to: Easytrieve LINE-COUNT current line system variable