The LINE statement is the layout engine for Easytrieve reports. After JOB logic decides which records matter via PRINT, the report writer reads LINE definitions to build each output row. Every field name or literal on LINE becomes a line item printed in order with default spacing from the REPORT SPACE value unless you adjust with plus or minus offsets, COL, or POS. Beginners often master TITLE headings first but leave columns misaligned because they skip LINE mechanics. Control reports add another layer: quantitative fields on LINE may automatically accumulate on summary lines unless SUM overrides. Extended reporting printers support font numbers per item. This page teaches syntax, multi-line groups, column control, LINESIZE interaction, XML report restrictions, and testing strategies for production spool listings.
12345REPORT PAY-RPT LINESIZE 80 TITLE 01 'PAYROLL DETAIL' LINE 01 EMPNO EMPNAME +5 DEPT GROSS LINE 02 POS 4 ADDRESS LINE 03 'NET==>' -2 PAY-NET POS 4 CITY ST ZIP
Broadcom's reference example shows a three-line group. LINE 01 prints employee number, name, extra space before department, and gross pay. LINE 02 prints ADDRESS aligned under the fourth item of LINE 01 via POS 4. LINE 03 mixes a literal prefix, reduced spacing before PAY-NET, and city-state-ZIP under the same column anchor.
| Parameter | Purpose | Notes |
|---|---|---|
| line-number | Row position in line group 1–99 | Default 1; ascending required for multiple LINEs |
| field-name | Library field value on print | W/S fields transfer at PRINT; S storage at print time |
| 'literal' | Static text or constant | Alphanumeric in quotes; numeric or hex forms allowed |
| +offset / -offset | Adjust space between items | Added to REPORT SPACE for absolute gap |
| COL column-number | Absolute column placement | Requires REPORT NOADJUST |
| POS position-number | Align under LINE 01 item | For LINE 02 through LINE 99 |
| #font-number | Extended printer font | Only when report uses extended reporting printer |
A line group is the set of LINE statements sharing one detail print cycle. When PRINT selects a record, the report writer emits LINE 01, then LINE 02, and so on for that record. Line numbers must increase without gaps or duplicates when you code more than one LINE. Omitting line-number on the first LINE defaults to 1. Exceeding 99 lines per group is invalid. Detail density affects page breaks: many LINE rows per record consume vertical space faster than single-line reports.
Field-name must exist in Library with DEFINE or FILE layout. The report writer uses field type for default editing unless masks or derived fields apply. K fields cannot appear on LINE per Broadcom restriction. Literals provide column headers embedded in detail, punctuation, or constant labels like NET===> in the reference sample. Mixing literals and fields on one LINE is common for annotated currency lines.
REPORT may specify SPACE between default line items. Plus offset widens the gap; minus offset tightens it. Absolute spacing is SPACE plus offset, bounded so the next item still fits within LINESIZE. When columns crowd or truncate, verify field lengths before chasing offsets—shortening a ten-byte name field in Library often fixes alignment better than large negative offsets.
POS aligns continuation lines under items numbered left-to-right on LINE 01. POS 4 places the next item under the fourth line item of LINE 01 regardless of varying widths above—useful for address lines under name columns. COL sets an absolute column number from 1 to LINESIZE maximum. COL requires NOADJUST on REPORT because default automatic adjustment would fight fixed columns. Extended reporting printers error if COL-positioned items overlap.
When CONTROL fields break the report, numeric quantitative fields listed on LINE may automatically total on summary lines. SUM statement can override or refine which fields accumulate at which break level. A LINE listing GROSS without SUM may still participate in auto-total behavior on control reports—verify behavior on your release with a small test file. Misunderstanding this produces double-counting when you also code redundant SUM on the same field.
REPORT LINESIZE sets logical line width. Sum of effective item widths plus spacing must not exceed LINESIZE or items truncate or wrap unpredictably. Match LINESIZE to printer or spool class—80 and 132 are common. TITLE lines obey the same width. Operations teams standardize LINESIZE per report class so SDSF viewers see consistent columns.
XML-formatted reports allow only one LINE statement; COL, POS, offsets, and font parameters are ignored except field-name and literal content. Migrating a multi-line LINE group to XML requires restructuring layout in the XML report feature documented in the Programming Guide.
1234567891011121314151617FILE PERSNL FB(150 1800) EMPNO 1 5 N EMPNAME 6 20 A DEPT 26 3 A GROSS 40 7 P 2 JOB INPUT PERSNL IF GROSS GT 0 PRINT PAY-RPT END-IF REPORT PAY-RPT LINESIZE 80 SPACE 2 TITLE 01 'ACTIVE PAYROLL' TITLE 02 'RUN DATE' RUN-DATE LINE 01 EMPNO EMPNAME DEPT GROSS CONTROL DEPT SUM GROSS
LINE 01 is the only detail layout line in this simple report. CONTROL DEPT breaks when department changes; SUM GROSS accumulates explicitly. TITLE lines precede LINE in the REPORT block. JOB PRINT must reference PAY-RPT by name.
TITLE builds page or section headers repeating on breaks or pages. LINE builds per-record detail rows when PRINT fires. Do not place detail fields only on TITLE expecting them to change per record—TITLE is largely static except for run-time fields you embed intentionally. Detail data belongs on LINE.
LINE is the template for one row on your report card. You list which names and numbers go left to right, like columns on notebook paper. POS is lining up the second row under a column from the first row. TITLE is the big heading at the top of the page; LINE is each student's row. PRINT tells the printer which students get a row; LINE says what to write on that row.
1. LINE statements belong in:
2. LINE 01 EMPNO EMPNAME lists:
3. POS 4 on LINE 02 means:
4. COL column-number requires:
5. Quantitative fields on LINE in control reports: