Names in Easytrieve are short, permanent, and everywhere—FILE fields, DEFINE working storage, REPORT layouts, PROC blocks, and macro names. A vague name like AMT1 confuses the next maintainer; a name that matches a newly reserved word breaks compile on upgrade night. Naming standards give your team a shared vocabulary: prefixes that show origin (input file versus calculated total), suffixes that show type (dates, flags, counts), and rules that keep macros aligned with COBOL copybooks upstream. This page teaches identifier constraints, recommended prefix tables, report and procedure naming, reserved word avoidance, and rename strategies during migration—written for beginners who inherit legacy source with eight-character cryptic labels.
Broadcom Easytrieve identifiers are traditionally short—often eight characters maximum for field names in many programs, though some constructs allow longer labels in specific contexts. Names consist of letters, digits, and in many cases embedded hyphens depending on statement type. The first character is alphabetic. Names are not case-sensitive in typical mainframe source—the compiler folds to uppercase. Your standard should assume uppercase storage and forbid lowercase in new source to match listing conventions. Always verify exact rules in the Language Reference for your maintenance level because online SCREEN field names and macro parameters can have additional constraints.
Reserved words are tokens the language uses as verbs, clauses, or special names—FILE, JOB, IF, REPORT, SCREEN, VALUE, and hundreds more. A field named VALUE or REPORT is a compile error or ambiguous parse on modern releases. Each upgrade adds reserved words; migration guides publish lists. Standards prohibit using dictionary verbs as field names and require grep scans before check-in. When legacy code uses risky names, rename with a prefix: VALUE becomes WS-VALUE-FLAG or IN-RECORD-VALUE depending on semantics—not VALUE-R renamed minimally if VALUE alone is illegal.
| Prefix | Use for | Example |
|---|---|---|
| (none) or IN- | Fields from FILE definition | EMPNAME, IN-DEPT |
| WS- | Working storage, calculations | WS-TOT-GROS |
| RPT- | Report line work fields | RPT-PG-CNT |
| FLG- | Single-character flags | FLG-EOF |
| IDX- | Indexes and counters | IDX-LINE |
| SCR- | Screen-only fields | SCR-MSG |
FILE names should match DD names in JCL where shop convention ties them—PAYROLL file in source maps to PAYROLL DD at runtime. Field names inside FILE should mirror enterprise data dictionary abbreviations when possible: EMP-NBR not E9. Document start position only in the macro comment block, not by encoding position in the name (BYTE94-AMT is an anti-pattern). Group related fields with shared stems: PAY-GROSS, PAY-NET, PAY-TAX for readability in REPORT LINE statements.
1234567FILE PAYROLL FB(150 1800) EMPNAME 17 8 A EMP-NBR 9 5 N DEPT 98 3 N PAY-GROSS 94 4 P 2 DEFINE WS-TOT-GROSS W 9 P 2
DEFINE creates fields not read directly from files—totals, scratch numerics, date conversions. Prefix every DEFINE with WS- unless it is a report-specific temporary (then RPT-). Avoid reusing FILE field names for DEFINE targets; MOVE and assignment become ambiguous in listings. For packed decimals, suffix P fields with context: WS-AVG-PAY not WS-AVG alone when multiple averages exist. Date fields should include DATE or DT in the name and comment the internal format (CCYYMMDD versus display mask).
REPORT names identify layout blocks—PAY-RPT, DEPT-SUM, ERR-LIST. Use a consistent suffix (-RPT, -SUM, -DTL) across the portfolio so PRINT statements are self-explanatory. TITLE and LINE statements reference field names; aligning REPORT field order with readable names speeds column debugging when output columns shift. Do not reuse the same REPORT name in multiple programs unless layouts are identical by standard—colliding names in shared macro libraries cause wrong headings.
When one JOB prints several reports, name each REPORT distinctly: PAY-DETAIL-RPT versus PAY-CONTROL-RPT. PRINT statements name the target explicitly. Standards should forbid PRINT without report name when multiple REPORT blocks exist—relying on defaults is fragile when someone adds a second layout later.
User PROC names should be verb phrases: CALC-TOTALS, FORMAT-DATE, VALIDATE-DEPT. Special-name procedures (BEFORE-LINE, BEFORE-SCREEN) are language-defined—do not invent alternate spellings. Macro names are often file-oriented: PAYROLL-FILE-MAC, GL-MASTER-MAC. Version suffixes (-V2) appear during migration when old and new layouts coexist briefly—remove suffix after cutover to avoid permanent clutter.
Online programs map screen fields to DEFINE or FILE fields. Prefix SCR- or map names matching BMS/map conventions your site uses. Message fields SCR-MSG-LINE1 should be documented for PF-key help text. Keep screen names distinct from batch-only fields so RESET behavior on SCREEN activities is predictable.
Names are labels on boxes. If every box says STUFF, you cannot find the crayons. If one box says OPEN and that word is also a command the robot understands, the robot gets confused. We use short labels with first letters that mean file box or scratch paper box, and we never use command words as labels. When the robot learns new command words, we relabel boxes before they clash.
1. Easytrieve identifiers typically allow up to:
2. A good working-storage field prefix is:
3. Renaming a field for migration reserved word collision should:
4. Report names in REPORT statements should be:
5. Procedure names benefit from verbs when they: