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.
123REPORT 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.
1LINE 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.
| Control | Effect | Example use |
|---|---|---|
| REPORT SPACE n | Default gap between items | SPACE 3 for readable listings |
| +offset | Add spaces beyond SPACE | +5 before amount column |
| -offset | Reduce gap | -1 to tighten codes |
| COL n | Absolute column (with NOADJUST) | COL 60 GROSS |
| POS n | Align under LINE 01 item n | POS 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.
123REPORT 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.
12345REPORT 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.
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.
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.
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.
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.
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.
1. LINE definitions belong in the:
2. POS 3 on LINE 02 aligns an item under:
3. COL on LINE typically requires:
4. LINE items can include:
5. Quantitative fields on LINE in control reports: