Easytrieve Maximum Lengths

Every language sets bounds—how long a name can be, how many digits a number literal accepts, how wide a source line may run before continuation. Easytrieve inherits the eighty-character mainframe record from its era while allowing surprisingly long identifiers compared to COBOL. Beginners hit limits when TITLE text overflows column seventy-two, when packed fields exceed numeric literal precision, or when generated code creates names longer than listing viewers display cleanly. This page catalogs Broadcom documented maximums and the practical limits teams impose below them for maintainability.

Progress0 of 0 lessons

Quick Reference Table

Documented maximum lengths
ItemMaximumNotes
Field name128 charactersLetters, digits, specials except delimiters
Label (JOB, PROC, etc.)128 charactersCannot be all numeric
Alphanumeric literal254 charactersSingle-quoted; DBCS/MIXED up to 254 bytes
Numeric literal digits18 digitsPlus optional sign and one decimal point
Source record80 charactersFixed on z/OS source libraries
Statement area (default)Columns 1-72Configurable via SCANCOLS/SCANCOLE
Hex literal bytesHalf of hex digit countEach pair = one byte; even digit count required

128-Character Identifiers

Field names and labels share the 128-character ceiling. The first character must be alphabetic, numeric, or national (# @ $). The name cannot be all numeric—that would collide with numeric literal syntax. Delimiters comma, quote, parentheses, and colon cannot appear inside the name. Long names help self-documenting code but wrap in compile listings and ISPF browse sessions. Many shops cap practical names at twenty to forty characters even though the compiler accepts more.

text
1
DEFINE WS-CUSTOMER-ACCOUNT-BALANCE-REMAINING-AFTER-DISCOUNT W 9 N 2

Qualification adds file name, colon, and field name. FILEA:WS-CUSTOMER-... counts each identifier separately toward its own limit; the combined text on one line must still fit the statement area or use continuation.

254-Character Alphanumeric Literals

Report titles, DISPLAY messages, and VALUE clauses may embed long text literals up to 254 characters. Coding them on one line rarely fits columns 1-72—use continuation with minus or plus at line end. Embedded apostrophes double the quote character and consume two columns per apostrophe in source even though the runtime string is one character.

text
1
2
TITLE 01 'REGIONAL PAYROLL EXCEPTION REPORT - INVALID DEDUCTION CODES -+ CONTACT HR SHARED SERVICES FOR CORRECTIONS'

18-Digit Numeric Literals

Numeric literals accept eighteen digits total across integer and fractional parts. Sign prefix and decimal point do not count toward the eighteen digits in Broadcom examples but affect how values map to packed, zoned, and binary fields. Assigning a literal with more precision than field DECIMALS truncates or rounds per field type rules. For currency with two decimal places, literals like 99999999999999.99 approach the practical ceiling.

  • Valid: 123, +123, -123.4321
  • Watch precision when target field is P 5 or N 7 2
  • Arithmetic expressions promote types per format rules—not unlimited precision

80-Character Source Records

z/OS source libraries store Easytrieve programs as eighty-character fixed records. Columns seventy-three through eighty traditionally hold sequence numbers for card sorters and audit trails. ISPF displays the full eighty columns; only the statement area is scanned for language syntax. Text beyond SCANCOLE is ignored by compilation but appears on listings— useful for change markers or version tags if your shop allows content there.

Configurable Statement Area

Installation options SCANCOLS and SCANCOLE set start and end columns scanned for source. Example: SCANCOLS 7 and SCANCOLE 72 leave columns 1-6 for sequence numbers and 73-80 for identification, matching classic COBOL card layouts. These are compile-time configuration options set in Configuration Manager; individual programs cannot override them. Teams migrating from other tools must verify scan columns match where code was indented historically.

text
1
2
Columns: 1....6 7.................72 73...80 Content: 001000 DEFINE WS-COUNT W 5 N 0 001000

Field LENGTH vs Literal Length

A 254-character literal assigned to a field defined LENGTH 20 truncates or abends depending on operation. MOVE long literal to short field is a common beginner error. Conversely, short literal MOVE to long field may pad with spaces for alphabetic types. Always match DEFINE LENGTH to file layout and literal size to DISPLAY or TITLE requirements separately.

Hex Literal Length

Hexadecimal literal byte length equals half the count of hex digits inside quotes. X'404040' is three bytes. Mask operations require masks no wider than the target field in bits or bytes per data type. DISPLAY of packed fields with hex masks teaches correct width faster than guessing from decimal literals alone.

Practical Limits Below Maximums

  1. Keep field names under forty characters for listing readability.
  2. Split TITLE text across two TITLE levels instead of one 200-character literal.
  3. Avoid numeric literals with more decimal places than target field DECIMALS.
  4. Reserve columns 73-80 for sequence numbers in governed source libraries.
  5. Document shop SCANCOLS if not default 1-72 so contractors indent correctly.

Common Length Mistakes

  • Literal exceeds 254 characters in generated code from macro expansion.
  • Statement extends past column 72 without continuation character.
  • All-numeric twelve-digit name rejected as identifier.
  • Hex literal with odd number of digits.
  • Qualified name line exceeds statement area without continuation.

Explain It Like I'm Five

Maximum lengths are ruler marks on paper you write on. Names can be very long—128 letters—but the paper line is only eighty boxes wide and only seventy-two count for your sentence. Stickers with words can be 254 letters if you continue on the next line with a plus sign. Numbers can have eighteen digits before the number gets too big for the sticker machine.

Exercises

  1. State five documented maximum lengths from memory after studying the table.
  2. Write a TITLE continued across two lines staying within column 72 each line.
  3. Calculate byte length of X'C1C2C3C4'.
  4. Explain why 80-column records persist on mainframe source libraries.
  5. Propose a team cap on field name length and justify it.

Quiz

Test Your Knowledge

1. Field names and labels may be up to:

  • 128 characters
  • 8 characters
  • 254 characters
  • 80 characters

2. Alphanumeric literals may be up to:

  • 254 characters
  • 128 characters
  • 72 characters
  • 18 characters

3. Numeric literals support at most:

  • 18 digits
  • 9 digits
  • 31 digits
  • 128 digits

4. Each Easytrieve source record is:

  • 80 characters
  • 72 characters
  • 132 characters
  • 254 characters

5. The default statement area spans columns:

  • 1 through 72
  • 8 through 71
  • 1 through 80
  • 7 through 76 only
Published
Read time12 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 Statement Overview and literal length rulesSources: Broadcom Easytrieve Report Generator 11.6 TechDocs, Statement Overview, Literal and Data Formatting Rules, Compiler OptionsApplies to: Easytrieve identifier, literal, and source record length limits