Easytrieve Report LINE

LINE is where report design becomes concrete. After PRINT chooses a record and TITLE/HEADING set context, LINE lists the fields and literals that form each detail row. Order on the LINE statement is left-to-right order on the page, separated by REPORT SPACE unless you tighten with negative offsets, widen with positive offsets, or pin items with COL or POS. Multi-line groups let one employee print as two physical rows—name on LINE 01, address on LINE 02—while still counting as one logical detail from one PRINT. Control reports reuse LINE quantitative fields for automatic totals. This page teaches LINE syntax for report writers, spacing math, COL versus POS, multi-line patterns, literals, LINESIZE fitting, totaling side effects, and layout testing so beginners stop shipping crooked columns.

Progress0 of 0 lessons

Basic LINE Syntax

text
1
2
3
REPORT PAY-RPT LINESIZE 100 SPACE 2 TITLE 01 'EMPLOYEE PAY LIST' LINE 01 EMP# NAME DEPT GROSS

LINE 01 introduces the first (primary) detail line. EMP#, NAME, DEPT, and GROSS print in that order. SPACE 2 puts two blanks between items by default. Field HEADING and MASK from DEFINE still apply. If only one LINE exists, some programs omit the number; with multiple LINE statements, number them ascending without duplicates.

Literals Mixed With Fields

text
1
LINE 01 EMP# ' ' NAME ' DEPT=' DEPT GROSS

Quoted literals insert fixed text between fields. Use them for punctuation, labels inline with data, or separators when HEADING alone is not enough. Too many literals clutter the row—prefer HEADING for column titles and keep LINE for values. Numeric and hexadecimal literals are also valid where the grammar allows.

Spacing Offsets

Horizontal spacing controls on LINE
ControlEffectExample use
REPORT SPACE nDefault gap between itemsSPACE 3 for readable listings
+offsetAdd spaces beyond SPACE+5 before amount column
-offsetReduce gap-1 to tighten codes
COL nAbsolute column (with NOADJUST)COL 60 GROSS
POS nAlign under LINE 01 item nPOS 2 on LINE 02

Offsets adjust one gap at a time. They do not change field lengths. If MASK makes GROSS twelve characters wide, plan SPACE and LINESIZE around the edited width, not the raw packed length.

COL and NOADJUST

text
1
2
3
REPORT ALIGNED LINESIZE 80 NOADJUST TITLE 01 'FIXED COLUMN EXTRACT STYLE' LINE 01 COL 1 EMP# COL 10 NAME COL 40 DEPT COL 50 GROSS

NOADJUST left-justifies layout instead of centering titles and freer spacing. COL then pins each item at an absolute print column—useful when users compare reports in a text editor or when columns must line up with an external template. Without NOADJUST, relying on COL can fight the default centering behavior. Pick one layout philosophy per report: flowing SPACE columns or absolute COL grid.

POS and Multi-Line Groups

text
1
2
3
4
5
REPORT ADDR-RPT LINESIZE 80 TITLE 01 'EMPLOYEE DIRECTORY' LINE 01 EMP# NAME LINE 02 POS 2 STREET LINE 03 POS 2 CITY ST ZIP

LINE 01 prints employee number and name. LINE 02 places STREET under the second LINE 01 item (NAME) via POS 2. LINE 03 stacks city/state/zip under the same name column. One PRINT still produces this three-row group. POS keeps the address visually under the name instead of restarting at the left margin. Number LINE statements in order; skipped numbers can insert blank vertical space depending on product rules—prefer consecutive numbers unless you intentionally skip.

LINESIZE Fitting

Mentally add edited widths plus gaps. Five columns of average width twelve with SPACE 3 need roughly 5×12 + 4×3 = 72 characters before title margins—LINESIZE 80 is comfortable; LINESIZE 60 is not. Overflow may truncate, wrap, or look misaligned on spool. When adding a column, re-check the math. SPREAD options on some reports redistribute space—mutually exclusive with NOADJUST in documented combinations—read REPORT options before combining.

LINE and Control Totals

On CONTROL reports, numeric fields listed on LINE often feed automatic total lines at breaks. SUM GROSS tells the writer to total only GROSS even if other numbers appear on LINE. Non-numeric fields do not total. Alignment of total amounts under the GROSS column depends on the same LINE structure—do not rearrange LINE items casually after users learn where totals sit.

Which Fields Belong on LINE

  • File fields from the selected record snapshot at PRINT.
  • Working-storage W/S fields assigned before PRINT.
  • Literals for fixed labels or separators.
  • Not JCL symbols, not DD names, not undefined fields.

If a field is missing from the work record because it was never referenced for the report, formatting cannot invent it—include it on LINE (or related report items) so PRINT captures it.

LINE Versus DISPLAY Formatting

DISPLAY EMP# NAME GROSS writes a quick line without HEADING inheritance or CONTROL totaling. LINE inside REPORT applies MASK, HEADING, page breaks, and spacing rules. Prototype with DISPLAY if you want, but ship business listings through LINE.

Common LINE Mistakes

  • Fields on LINE never assigned before PRINT.
  • COL without NOADJUST expectations.
  • POS pointing at the wrong LINE 01 item number.
  • LINESIZE too small after adding MASK widths.
  • Duplicate or out-of-order line-numbers.
  • Using LINE as a substitute for PUT extracts.

Testing LINE Layouts

  1. Print three sample rows; verify column order matches LINE order.
  2. Check heading labels sit over the intended values.
  3. Add MASK; remeasure width against LINESIZE.
  4. Test multi-line POS alignment on a 132-column and 80-column report.
  5. On CONTROL reports, confirm totals underline the amount columns.

Explain It Like I'm Five

LINE is the row of empty boxes you draw on paper before you fill in answers. First box is employee number, second is name, third is pay. SPACE is how far apart you draw the boxes. COL is when you use a ruler and say the pay box starts at mark 50. POS is when the second row's address box sits under the name box so it looks neat. PRINT chooses which kid's answers go into those boxes.

Exercises

  1. Write LINE 01 with four fields and SPACE 2 on LINESIZE 100.
  2. Rebuild the same layout with NOADJUST and COL positions.
  3. Add LINE 02 with POS under the name column for an address.
  4. Calculate approximate width for your LINE items including MASK.
  5. Explain why SUM and LINE order matter for total alignment.

Quiz

Test Your Knowledge

1. LINE definitions belong in the:

  • REPORT subactivity
  • JCL only
  • SCREEN KEY list
  • STEPLIB

2. POS 3 on LINE 02 aligns an item under:

  • The third item on LINE 01
  • Column 3 only always
  • TITLE 03
  • CONTROL level 3

3. COL on LINE typically requires:

  • REPORT NOADJUST
  • SQL FILE
  • MACRO
  • EOF

4. LINE items can include:

  • Field names and literals
  • Only JCL DD names
  • Only PROC names
  • Only VSAM passwords

5. Quantitative fields on LINE in control reports:

  • May auto-total unless SUM restricts them
  • Never print
  • Disable TITLE
  • Require RELATIVE files

Related Pages

Published
Read time17 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve Report Generator 11.6 LINE statement and report layoutSources: Broadcom Easytrieve 11.6 Language Reference LINE, REPORT SPACE COL POSApplies to: Easytrieve report detail LINE layout