Easytrieve Identifiers

Identifiers are the names you assign to data fields, job activities, procedures, reports, and branch targets. Every IF that references EMPNO, every PERFORM that calls CALC-TAX, and every GOTO that jumps to CHECK-REGION depends on identifier rules the compiler enforces before execution. Broadcom allows long descriptive names up to 128 characters, forbids certain delimiter characters inside names, and requires qualification when the same name appears in multiple files. Naming well on day one prevents rename migrations when reserved words or duplicate symbols surface at compile time.

Progress0 of 0 lessons

Identifiers Name Things

In Easytrieve syntax, identifiers are words that name objects: field names in FILE and DEFINE, labels on JOB and PROC statements, REPORT names, SCREEN names, and statement labels used with GOTO. They differ from keywords, which have fixed language meaning, and from literals, which are constant values in quotes or numeric form. The compiler resolves identifiers against symbol tables built from Library and activity declarations.

Field Name Rules

Field names may contain up to 128 characters from alphabetic A-Z, digits 0-9, and special characters except delimiters. The first character must be alphabetic, numeric, or national (#, @, $). The name cannot be all numeric—12345 alone is invalid because the compiler would confuse it with a numeric literal. At least one alphabetic or special character distinguishes field names from numbers.

Field name validity examples
NameValid?Note
EMPNOYesClassic short name
WS-TOTAL-COUNTYesHyphen often used in working storage
#REGION-CODEYesNational character allowed at start
12345NoAll numeric—not allowed
FILEA:EMPNOQualified referenceNot a single identifier—qualification syntax

Forbidden Characters in Identifiers

Identifiers cannot contain comma, single quote, left parenthesis, right parenthesis, or colon. These characters serve delimiter roles in qualification, literals, and parameter lists. If business terminology includes punctuation, translate to hyphens or abbreviations in field names: CUST-ID not CUST:ID as an unqualified name.

Uniqueness and Qualification

All working storage field names must be unique. All field names within one FILE definition must be unique. The same name may appear in two files or in both a file and working storage only when you qualify references: FILEA:FLD1, WORK:FLD1. The compiler uses qualification to choose the correct symbol. Unqualified duplicate definitions produce compile errors or ambiguous references depending on context.

text
1
2
3
4
5
6
7
8
9
FILE FILEA FB(80 800) STATUS 1 1 A FILE FILEB FB(80 800) STATUS 1 1 A IF FILEA:STATUS EQ 'A' MOVE FILEB:STATUS TO WS-HOLD END-IF

Label Identifiers

Labels identify PROGRAM, JOB, SCREEN, SORT, PROC, REPORT, and GOTO targets. Labels follow similar length and character rules but cannot consist entirely of numeric characters. proc-name. PROC combines label identifier with PROC keyword. Statement labels for GOTO may appear on their own line before executable statements inside an activity.

Identifiers vs Reserved Words

Reserved words are keywords you cannot use as field names—IF, JOB, REPORT, EXECUTE, and many system field names like SYSDATE. Non-reserved keywords may sometimes serve as field names in appropriate context, but using them harms readability. Prefer business-oriented names and check reserved lists when compile errors flag invalid field declarations.

Naming for Maintenance

  • Prefix working storage with WS- or W- per shop standards.
  • Use descriptive names over cryptic three-letter legacy unless matching copybooks.
  • Align FILE field names with enterprise data dictionary when available.
  • Keep REPORT names distinct from FILE names to avoid confusion in PRINT statements.
  • Document label purpose when GOTO targets are not obvious from the name alone.

Migration and Renames

Upgrading to Easytrieve 11.6 function mode added reserved words such as EXECUTE, SET, and LOGICAL-RECORD. Legacy programs using those strings as field names fail until renamed. Plan identifier audits during migration: search source libraries for new reserved words and rename fields with consistent prefixes before mass recompile.

Common Identifier Mistakes

  1. Defining duplicate unqualified field names in two FILE statements.
  2. Using reserved word STATUS when a report PROC or system field conflicts.
  3. All-numeric label attempted for GOTO target.
  4. Embedding comma or quote inside a field name from copy-paste data dictionary errors.
  5. Referencing EMPNO without qualification when two files both define EMPNO.

Explain It Like I'm Five

Identifiers are name tags on boxes and doors in a warehouse. Each box gets one clear name so workers find the right parts. If two boxes had the same name, you would add the aisle name before the box name— that is qualification. Some names are reserved for fire exits and you cannot use those for boxes—that is reserved words. Names cannot include punctuation that the warehouse uses for signs, like commas and colons in the wrong places.

Exercises

  1. Write qualified references for STATUS in two different files.
  2. Explain why 999 alone is not a valid field name.
  3. List four characters forbidden inside identifiers.
  4. Rename a field EXECUTE to avoid 11.6 reserved word conflict.
  5. Propose naming standards for working storage versus FILE fields.

Quiz

Test Your Knowledge

1. Easytrieve identifiers include:

  • Field names and statement labels
  • JCL DD names only
  • Tape volsers
  • Binder cards only

2. Field names may be up to:

  • 128 characters
  • 8 characters only
  • 30 characters
  • 256 characters

3. An identifier cannot consist of:

  • All numeric characters only
  • Letters and digits mixed
  • National characters with letters
  • Hyphens

4. Colon inside an identifier name is:

  • Invalid—colon is for qualification syntax
  • Required
  • Only in comments
  • Only in JCL

5. Duplicate field names across files require:

  • Qualification with file name or WORK
  • Deleting one file
  • Renaming JCL
  • Two REPORT sections
Published
Read time12 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 identifier and field name rulesSources: Broadcom Easytrieve Report Generator 11.6 TechDocs, Syntax Rules, Symbols and Reserved WordsApplies to: Easytrieve field names, labels, and qualification