Easytrieve Reserved Words Cheat Sheet

Reserved words are tokens the Easytrieve language owns—you cannot declare them as your own field names without compile errors or migration surprises. They include statement keywords (IF, JOB, REPORT), automatic procedure hook names (BEFORE-LINE, AFTER-SCREEN), system fields (SYSDATE, EOF), and special constants. Beginners collide with reserved words when choosing obvious names like SET or DATE; veterans hit new conflicts when Broadcom adds keywords in 11.x function mode. This cheat sheet compresses the highest-impact reserved words into quick-scan tables for desk reference, interview review, and migration scanning. For full tutorials on individual words, use the reserved words section index; for official completeness, open Broadcom Symbols and Reserved Words for your release.

Progress0 of 0 lessons

Naming Rules (Quick)

  • Never use reserved words as DEFINE or FILE field names.
  • Prefer business prefixes: WS-, FL-, IN-, RPT-, CNT-.
  • Scan libraries before function-mode migration for new conflicts.
  • Special-name PROC labels are reserved hooks—do not use for user PERFORM targets.

Statement and Activity Keywords

These words introduce statements or activities. Using them as field names breaks compile or causes ambiguous parse errors.

Core statement keywords (sample — not exhaustive)
WordRoleIf you need a field name
JOBBatch activityJOB-ID, JOB-CODE (with prefix)
REPORTReport activityRPT-ID, RPT-NAME
FILEFile definitionFILE-NUM, FL-NAME
IF / ELSE / END-IFConditional logicIF-FLAG, WS-IF-COND (avoid IF alone)
PERFORMCall procedurePERFORM-CNT (rare need)
PROC / END-PROCProcedure delimitersPROC-NAME as label only, not field
SORTSort activity/statementSORT-KEY, SORT-SEQ
SCREENOnline activitySCR-ID, SCREEN-CODE with prefix
GET / READ / WRITEI/O verbsGET-CNT, READ-FLAG
DISPLAYSYSPRINT outputDISP-CNT if truly needed
CALLExternal programCALL-CODE
MACRO / MENDMacro prototypeMACRO-ID (not MACRO)
LIBRARYLibrary sectionLIB-VERSION
SETAssignment keyword (11.6+ reserved)FL-SET, WS-SET-VAL

Report Procedure Hooks (Reserved PROC Names)

The report writer calls these procedure names automatically. You code the PROC body; you do not PERFORM them from JOB logic for normal report flow.

Report special-name procedures
NameWhen invoked
BEFORE-LINEBefore each detail line prints
AFTER-LINEAfter each detail line
BEFORE-BREAKBefore control break group
AFTER-BREAKAfter break—subtotals common here
BEFORE-REPORTReport start hook (release-dependent names)
AFTER-REPORTReport end hook

Screen Procedure Hooks

Screen special-name procedures
NameWhen invoked
INITIATIONOnce when SCREEN activity starts
BEFORE-SCREENBefore each terminal display cycle
AFTER-SCREENAfter user input received
TERMINATIONWhen SCREEN activity ends

GOTO SCREEN, REFRESH, and RESHOW are invalid inside BEFORE-SCREEN per Broadcom screen procedure rules—memorize for interviews and code review.

System Fields and Special Symbols

Common system fields (reference, do not DEFINE as user fields)
FieldMeaning
SYSDATECurrent system date
SYSTIMECurrent system time
SYSUSER / SYSUSERIDUser context (release naming varies)
EOFEnd-of-file condition for named file
LINE-NUM / PAGE-NUMReport line or page counters (context-dependent)
LOW-VALUES / HIGH-VALUESSpecial constant references

Migration Hot List (11.x)

Words newly reserved or enforced in recent Broadcom releases break legacy programs that used them as field names. Scan and rename before function-mode compile.

  • SET — assignment keyword; rename user fields named SET.
  • Review release notes for additional R-marked symbols each upgrade.
  • Compatibility mode may warn before hard failure—treat warnings as debt with deadline.
text
1
2
3
4
5
* BAD (11.6 function mode) DEFINE SET 5 N * BETTER DEFINE FL-SET-FLAG 5 N

Operators and Delimiters

Comparison and arithmetic operators (EQ, NE, GT, GE, LT, LE, AND, OR, NOT) are keywords in expressions—not field names. END-IF closes IF blocks; END closes activities. Confusing END with END-PROC causes structure errors beginners see in compile listings.

Print-Friendly Quick List

Activities: JOB, REPORT, SORT, SCREEN. I/O: FILE, GET, READ, WRITE, OPEN, CLOSE. Control: IF, ELSE, END-IF, PERFORM, PROC, END-PROC, GOTO, EXIT, STOP. Report layout: TITLE, LINE, SKIP, PRINT. Hooks: BEFORE-LINE, AFTER-BREAK, BEFORE-SCREEN, AFTER-SCREEN, INITIATION, TERMINATION. System: SYSDATE, SYSTIME, EOF. Migration watch: SET.

Explain It Like I'm Five

Reserved words are like the teacher's special words on the classroom board—you cannot name your pet hamster “Homework” if the teacher uses that word every day for assignments. Pick a different hamster name with a prefix sticker so nobody confuses the pet with the assignment word.

Practice Exercises

  1. Find five reserved words in a sample program and suggest safer field names.
  2. Memorize four report hooks and one sentence each for when they run.
  3. List three system fields and where you would use SYSDATE in a TITLE.
  4. Write a migration scan plan for SET field renames across a library.
  5. Quiz a partner: you say a word, they say reserved or safe with alternative.

Quiz

Test Your Knowledge

1. Reserved words cannot be used as:

  • User-defined field names
  • JCL DD names only
  • Comment text
  • Sequence numbers

2. BEFORE-LINE is reserved because it names:

  • Automatic report procedure hook
  • Sort key
  • File buffer
  • Macro invocation

3. SYSDATE provides:

  • Current system date for titles and logic
  • Compile timestamp only
  • JCL date
  • User password

4. SET as a user field name fails in 11.6 because:

  • SET became a reserved keyword
  • SET is a JCL proc
  • SET removes SORT
  • SET is a DD name

5. To fix reserved word conflict you should:

  • Rename field with prefix like WS- or FL-
  • Delete program
  • Remove FILE defs
  • Disable compile
Published
Read time12 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve Symbols and Reserved Words (11.6)Sources: Broadcom Easytrieve Language Reference; reserved words index tutorialsApplies to: Easytrieve reserved words quick reference