Easytrieve LINE Statement

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.

Progress0 of 0 lessons

Statement Format

text
1
2
3
4
5
REPORT 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.

LINE Parameters Explained

LINE statement parameters
ParameterPurposeNotes
line-numberRow position in line group 1–99Default 1; ascending required for multiple LINEs
field-nameLibrary field value on printW/S fields transfer at PRINT; S storage at print time
'literal'Static text or constantAlphanumeric in quotes; numeric or hex forms allowed
+offset / -offsetAdjust space between itemsAdded to REPORT SPACE for absolute gap
COL column-numberAbsolute column placementRequires REPORT NOADJUST
POS position-numberAlign under LINE 01 itemFor LINE 02 through LINE 99
#font-numberExtended printer fontOnly when report uses extended reporting printer

Line Groups and line-number

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.

Fields Versus Literals

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.

Spacing: SPACE, +offset, and -offset

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.

COL Versus POS

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.

Control Reports and Auto-Totals

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.

LINESIZE and Wrapping

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 Reports

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.

Complete JOB and REPORT Example

text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
FILE 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.

LINE Versus TITLE

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.

Testing LINE Layout

  1. Run with two known records and verify column order matches LINE sequence.
  2. Check POS alignment on multi-line groups with longest field values.
  3. Confirm LINESIZE truncation with maximum-width data.
  4. Validate control break subtotals against manual sums.
  5. Compare COL layout with NOADJUST against default SPACE adjustment.

Common LINE Mistakes

  • Field on LINE not defined in Library.
  • COL without REPORT NOADJUST.
  • Duplicate or out-of-order line-number values.
  • Expecting formatting from PRINT alone.
  • POS reference to nonexistent LINE 01 item number.
  • K field on LINE causing compile error.

Explain It Like I'm Five

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.

Exercises

  1. Write a REPORT with two TITLE lines and one LINE listing four fields.
  2. Add LINE 02 with POS 2 under a name field on LINE 01.
  3. Explain when to use COL instead of POS.
  4. Design a three-line group for employee, address, and pay net.
  5. Document LINESIZE choice for 80-column spool versus 132.

Quiz

Test Your Knowledge

1. LINE statements belong in:

  • REPORT subactivity after JOB logic
  • Environment PARM only
  • JCL EXEC card
  • Linker control file

2. LINE 01 EMPNO EMPNAME lists:

  • Detail fields printed when PRINT selects the report
  • Library DEFINE offsets only
  • Sort keys
  • Screen map rows

3. POS 4 on LINE 02 means:

  • Align under the fourth item on LINE 01
  • Print at column 4 only
  • Skip four records
  • Fourth control break

4. COL column-number requires:

  • NOADJUST on the REPORT statement
  • SORT before JOB
  • SCREEN activity
  • MACRO expansion

5. Quantitative fields on LINE in control reports:

  • May auto-total on summary lines unless SUM overrides
  • Never print numbers
  • Require SQL
  • Replace TITLE
Published
Read time17 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve Report Generator 11.6 LINE statementSources: Broadcom Easytrieve 11.6 Language Reference LINE Statement, Report SectionApplies to: Easytrieve LINE report detail layout