Easytrieve Statement Terminators

Statement terminators tell the compiler where one instruction ends and the next begins. Easytrieve uses implicit line endings, explicit period-space separators, continuation characters, and block-ending keywords like END-PROC and END-IF. Beginners who mash two assignments on one line without a period, or who leave a stray plus at line end, trigger errors that point to the wrong statement. This page explains each termination mechanism, when to use it, and how it interacts with comments and multi-statement lines.

Progress0 of 0 lessons

Default Line Termination

In the default statement area columns 1-72, the last non-blank character normally terminates the statement unless that character is a continuation sign. A simple line like MOVE A TO B ends at the final B. The compiler does not require a trailing period on every line when only one statement occupies the record. This implicit termination keeps source readable and matches how most programmers write one statement per line.

Period-Space Explicit Termination

To place more than one statement on a single line, end the first with a period followed by at least one space, then start the next statement. The period is a delimiter, not part of a decimal literal in that role—it marks statement boundary. Inline comments also use period-space-asterisk after a complete statement on the same line.

text
1
2
COST = FIXED + VARIABLE. PRICE = COST + PROFIT TOTAL = COST + TAX. * inline comment after assignment

First line holds two assignments separated by period-space. Second line assigns TOTAL then documents intent with inline comment syntax. Without the period after VARIABLE, the compiler would interpret PRICE as part of the first expression incorrectly or fail with syntax errors.

Continuation Characters

When a statement does not fit one line, the last non-blank character may be minus (-) or plus (+) to continue on the next record. Minus continuation resumes at the start of the next statement area. Plus continuation resumes at the first non-blank character on the next line. Between words, both styles behave similarly in Broadcom examples; difference matters when splitting inside a literal or token.

text
1
2
3
4
5
6
7
FIELD-NAME W 6 A + VALUE 'ABC - DEF' FIELD-NAME W 6 A + VALUE 'ABC + DEF'

Both forms define the same VALUE literal split across lines when continuation rules are applied correctly. Do not place comments on continuation lines inside the continued statement—the compiler rejects comments within continued statements.

Termination Mechanisms Compared

How statements end
MechanismWhen usedEffect
Line end (implicit)Single statement per lineLast non-blank ends statement
Period + spaceMultiple statements or inline commentExplicit boundary before next token
Trailing minus (-)Long statement continues next line at column 1Suppresses termination at line end
Trailing plus (+)Long statement continues next line at first non-blankSuppresses termination at line end
END-* keywordsClosing IF, PROC, DO blocksDelimits structured block, not general lines

Block Terminators vs Line Terminators

END-IF, END-PROC, END-DO, and similar keywords close structured blocks opened by IF, PROC, or DO. They are not interchangeable with period-space line terminators. An END-IF does not allow another unrelated statement on the same line unless period-space rules still apply after the END-IF token. Nesting blocks requires matching END keywords in correct order— the compiler matches IF to END-IF across nested levels like other structured languages.

Period in Other Roles

Period also appears as delimiter after labels: proc-name. PROC uses period between label and keyword. Do not confuse label period with statement terminator period-space in multi-statement lines. Decimal points inside numeric literals follow numeric literal rules, not statement termination rules. Context determines which role period plays.

Statement Area Limits and Termination

Characters beyond column 72 in the default area are ignored or treated as sequence area depending on site setup. A statement that runs past column 72 without continuation appears truncated to the compiler, often producing mysterious incomplete token errors. Use continuation rather than wrapping blindly. Columns topic covers sequence numbers in 73-80 when shops require them.

Comments and Termination

Full-line comments starting with * never terminate other statements—they are separate records. Inline comments require a completed statement, then period, spaces, asterisk, comment text. You cannot start inline comment in the middle of an incomplete statement. Continued statements forbid embedded comment lines until the continuation completes.

Debugging Terminator Errors

  1. Check for missing period-space between statements on one line.
  2. Look for stray + or - at line end unintentionally continuing statements.
  3. Verify END-IF count matches IF count in nested blocks.
  4. Confirm continued literals close quotes on the correct continuation line.
  5. Read compiler message line number and inspect prior line for bad termination.

Style Recommendations

  • Prefer one statement per line in production source for clarity.
  • Use period-space multi-statements only for trivial related assignments.
  • Break long MASK or PARM lines with continuation instead of horizontal scrolling.
  • Align END-IF with matching IF indentation to spot missing terminators visually.
  • Avoid trailing spaces before continuation characters—they may confuse editors.

Common Mistakes

  • Two JOB statements on one line without period-space between them.
  • Orphan plus at end of line continuing into unrelated next line.
  • Comment line inserted inside continued DEFINE value.
  • Assuming END-PROC optional—it is required for every PROC.
  • Using comma alone to separate statements on one line—it is not sufficient.

Explain It Like I'm Five

Statement terminators are punctuation that tells the computer where one instruction ends. A newline is like putting the period at the end of a sentence on its own line. Period-space is like writing two short sentences on one line with a dot between them. Minus and plus at the line edge mean the sentence continues on the next line of paper. END-IF is like writing the end of a story chapter—not every sentence, but a whole section wrapped up.

Exercises

  1. Rewrite two assignments as one line using period-space termination.
  2. Split a long TITLE literal across two lines with continuation.
  3. Explain difference between implicit line end and period-space on same line.
  4. Find and fix a sample line with missing END-IF for nested IF.
  5. Write an inline comment after a valid statement using period-asterisk syntax.

Quiz

Test Your Knowledge

1. Multiple statements on one line are separated by:

  • Period followed by space
  • Comma only
  • END-IF
  • Double colon

2. The last non-blank character ends a statement unless it is:

  • Minus (-) or plus (+) continuation
  • Always period
  • Asterisk only
  • Letter Z

3. Minus (-) continuation at line end means:

  • Next line continues at start of statement area
  • Comment follows
  • Delete the line
  • End of program

4. Plus (+) continuation differs from minus when:

  • Continuing in the middle of a word vs between words
  • Never differs
  • Only in JCL
  • Only in REPORT

5. END-PROC terminates:

  • A PROC procedure block
  • The entire program always
  • FILE definition only
  • JCL job step
Published
Read time11 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 statement termination and continuation syntax rulesSources: Broadcom Easytrieve Report Generator 11.6 TechDocs, Easytrieve Syntax RulesApplies to: Easytrieve statement boundaries and line continuation