Easytrieve exposes dozens of statement keywords. Alphabetical indexes help when you already know the spelling from a compile error. Category indexes help when you know the job—define a file, sum a column, break on department, show a screen—but not which keyword Broadcom chose. This page groups statements into functional families: environment options, data definition, file I/O, arithmetic and data movement, control flow, reporting, report events, modular procedures, sorting, tables, screens, and database access. Each row links to a dedicated tutorial with syntax, examples, quizzes, and common mistakes. Use it alongside statements reference for A–W lookup and statements overview for section-based skeleton. Production programmers bookmark both category and alphabetical views because maintenance tasks arrive as problems, not as sorted vocabulary lists.
| Statement | Purpose | Tutorial |
|---|---|---|
| PARM | Compile and execute options, DEBUG, ABEXIT | /syntax (PARM in overview) |
| PROGRAM | Name program activity entry | /statements/job |
| EXECUTE | Run named activity from driver | /activity-section |
| STOP | End program execution | /statements/stop |
Definition statements describe shape of data before runtime logic executes. They belong in Library section—not inside IF blocks. FILE names the logical file and record layout prefix. DEFINE declares fields with type and offset. TABLE builds in-memory lookup structures. MACRO defines compile-time text substitution when your release supports it.
| Statement | Purpose |
|---|---|
| FILE | Declare file organization and buffer |
| DEFINE | Field name type offset length |
| TABLE | In-memory table for LOOKUP |
| MACRO | Macro definition or call |
I/O statements move records between datasets and program fields. OPEN prepares file. READ GET sequential or keyed access. WRITE PUT output. CLOSE releases. SELECT filters during report or sort. ACCESS opens database or extended file types on Plus installations. Job driver JOB INPUT ties loop to primary file.
| Statement | Purpose |
|---|---|
| OPEN | Open file for processing |
| READ | Read next sequential record |
| GET | Read keyed or relative record |
| WRITE | Write output record |
| CLOSE | Close file |
| ACCESS | Database or extended access path |
| JOB INPUT | Declare driver file for activity |
MOVE assigns field values. ADD increments accumulators—ADD A TO B distinct from assignment A = A + B style. PARSE splits delimited strings. DISPLAY writes diagnostics to SYSPRINT. Arithmetic also appears in assignment expressions with operators—see operators section for + - * / ** MOD.
| Statement | Purpose |
|---|---|
| MOVE | Move or assign between fields |
| ADD | Add value to numeric field |
| PARSE | Parse structured or delimited text |
| DISPLAY | Diagnostic line to SYSPRINT |
Control flow steers which statements run. IF ELSE END-IF conditional blocks. DO END-DO and WHILE loops. CASE multi-way branch. GOTO LABEL transfer—use sparingly. END closes various blocks per preceding keyword context.
| Statement | Purpose |
|---|---|
| IF / ELSE / END-IF | Conditional execution |
| DO / END-DO | Loop block |
| WHILE | Condition-driven loop |
| CASE | Multi-value branch |
| GOTO / LABEL | Unconditional branch target |
Declarative report statements define output appearance. REPORT starts subactivity. TITLE heading lines. LINE detail columns. CONTROL break field. SUM totals. PRINT in JOB selects records for named report. TOTAL may appear in report grammar per release.
| Statement | Purpose |
|---|---|
| REPORT | Start report definition block |
| TITLE | Page or section headings |
| LINE | Detail column layout |
| Select record for report | |
| CONTROL | Control break field (in REPORT) |
| SUM | Accumulate on report breaks |
Report events are not always standalone top-level statements—they are PROC modules with reserved names the report writer invokes. AFTER-BREAK runs after control break processing. BEFORE-LINE runs before each detail line. See procedures tutorial for full event list and placement immediately after REPORT subactivity.
| Event PROC name | When invoked |
|---|---|
| REPORT-INPUT | Each selected record before detail |
| BEFORE-BREAK | Before control break output |
| AFTER-BREAK | After control break totals |
| BEFORE-LINE | Before detail line print |
| AFTER-LINE | After detail line print |
| TERMINATION | End of report processing |
| Statement | Purpose |
|---|---|
| PROC / END-PROC | Define procedure module |
| PERFORM | Invoke user PROC |
| CALL | Call external program |
| RETURN | Return from called routine |
SORT activity statements reorder files—see sort tutorials. SCREEN activity defines terminal layouts. BEFORE-SCREEN and AFTER-SCREEN event PROCs bracket display and input—mirror report event pattern for online transactions.
| Statement | Purpose |
|---|---|
| SCREEN | Define screen activity and layout |
| BEFORE-SCREEN | Logic before screen display |
| AFTER-SCREEN | Logic after operator input |
| INITIATION | Screen activity startup PROC |
Category tells what the statement does. Program section tells where it may appear. FILE is definition category but Library section only. PRINT is I/O and reporting category but Activity procedural logic. REPORT is reporting category but declarative block at JOB end. Compile errors often mean right category wrong section—move statement rather than rename it.
12345678910111213* Definition (Library) → Activity (procedural) → Report (declarative) FILE PAYROLL ... DEFINE fields... JOB INPUT PAYROLL IF GROSS GT 0 ADD GROSS TO WS-TOTAL PRINT PAY-RPT END-IF REPORT PAY-RPT TITLE 'PAYROLL' LINE EMP-NO GROSS
Categories are drawers in a tool chest. Hammer drawer has tools for hitting—ADD and MOVE. Ruler drawer has tools for measuring layout—LINE and TITLE. Door drawer has tools for going different ways—IF and GOTO. Alphabetical list is every tool sorted by name. Category list is tools sorted by what job they help you do.
1. FILE and DEFINE belong to which category?
2. IF DO WHILE and GOTO are:
3. AFTER-BREAK and BEFORE-LINE are:
4. This page differs from alphabetical statements reference by:
5. Minimal batch program uses categories: