Easytrieve allows field names up to 128 characters and supports descriptive identifiers rare in older eight-character COBOL worlds. That freedom helps readability but demands discipline: without team standards, one programmer prefixes working storage with WS, another uses W, and a third uses no prefix at all. Duplicate unqualified names across files cause compile failures. Reserved words like TOTAL or EXECUTE block compilation after upgrades. This page documents practical naming conventions beginners can adopt immediately and teams can codify in standards manuals—prefixes, qualification, labels, report names, and alignment with enterprise data dictionaries.
A good Easytrieve name answers three questions at a glance: what data it holds, where it lives (file versus working storage), and whether it is input, output, or control. Names should resist future reserved word lists, survive 80-column listings without truncation confusion, and match downstream COBOL or DB2 terminology when systems share files. Cryptic three-letter legacy names may remain when maintaining old programs, but new development should favor clarity over brevity within reasonable line length.
Most shops prefix working storage fields defined after W in DEFINE statements. WS- is the most common prefix in North American sites; W- or WK- appear in others. The prefix signals that a name is not a column in a FILE layout—a critical distinction when reading IF statements and MOVE operations during incident triage at 2 a.m.
123DEFINE WS-HOLD-STATUS W 1 A DEFINE WS-TOTAL-GROSS W 9 N 2 DECIMALS DEFINE WS-ERR-COUNT W 5 N 0
| Prefix | Typical use | Example |
|---|---|---|
| WS- | General working storage | WS-COUNTER |
| IN- | Input hold areas before validation | IN-RAW-AMT |
| OUT- | Formatted output before WRITE | OUT-REPORT-LINE |
| ERR- | Error flags and messages | ERR-SWITCH |
| IDX- | Indexes and loop counters | IDX-TABLE |
FILE field names should mirror record layouts in copybooks, data dictionaries, or file documentation. When EMP-NO is the enterprise standard, do not rename to EMPLOYEE_NUMBER in Easytrieve unless the entire pipeline adopts the change. POSITION and LENGTH must align with physical layout—naming cannot fix wrong offsets. Use the same abbreviations COBOL uses for the file so cross-team conversations stay aligned.
When the same name appears in multiple files or in WORK and a FILE, qualify every reference in maintainable code—even when the compiler might infer context. FILEA:STATUS and FILEB:STATUS beat ambiguous STATUS in nested IF logic. Broadcom allows flexible spacing around the colon: FILEA:FLD1, FILEA : FLD1. Pick one spacing style per shop and stay consistent.
123IF PERSNL:DEPT EQ WORK:SAVE-DEPT MOVE PERSNL:GROSS TO WS-LINE-GROSS END-IF
Procedure labels should verb-noun describe action: CALC-TAX, VALIDATE-REGION, WRITE-TRAILER. JOB activity names often reflect business function: JOB-PAYROLL-EXTRACT. GOTO labels like SKIP-INVALID-REC should state why the branch exists. Avoid generic names—PROCESS, LOOP1, AGAIN—that appear hundreds of times in a library. Labels cannot be all numeric and cannot contain delimiter characters.
REPORT names tie to PRINT statements. Use names operations recognize: PAY-DETAIL-RPT, PAY-EXCEPTION-RPT. Do not reuse FILE names as REPORT names—PRINT PERSNL reads like printing a file, not formatting a report. SCREEN names for online activities should indicate panel purpose: SCR-EMP-INQUIRY. Document mapping from report name to SYSOUT DD in run books.
Broadcom reserves uppercase English keywords and many system field names—SYSDATE, SYSTIME, RETURN-CODE. New 11.6 reserved words include EXECUTE, SET, LOGICAL-RECORD. Run periodic scans before upgrade projects. Prefer ws-execute or custSet over bare EXECUTE or SET. Non-reserved keywords used as field names may compile but confuse readers who see MOVE as both keyword and identifier in different lines.
One hundred twenty-eight characters is the technical maximum; practical maximum depends on your editor and listing width. Names longer than thirty characters may wrap awkwardly in compile listings. Balance descriptiveness: WS-TOTAL-GROSS-PAY-USD beats WS-TGP for a new hire reading the program, but WS-TOTAL-GROSS-PAY-AMOUNT-FOR-CURRENT-PAY-PERIOD-USD may exceed sensible line width when qualified with file names.
Field names may start with national characters #, @, $. Some shops use @ for temporary migration fields or # for constants. Document any special national-character meaning in team standards so #TAX-RATE is understood as a table key prefix, not a social media tag.
Naming conventions are like color codes on boxes in a big warehouse. Red stickers mean temporary storage, blue stickers mean shipped from the factory file, and each sticker uses words everyone agreed on so no one opens the wrong box. If two boxes need the same word, you add the aisle name before the word so pickers know which aisle to visit.
1. Broadcom recommends your field names should be:
2. A common working storage prefix is:
3. Duplicate field names in two files require:
4. PROC labels should:
5. REPORT names should: