Easytrieve source is a sequence of statements—not arbitrary text. Each statement type has a place in the program skeleton, a keyword introducing it, parameters you must or may supply, and interaction rules with other statements. Beginners overwhelmed by the language reference should start with clusters: environment options, library definitions, job processing, report layout, and modular PROCs. This map shows which statements belong where, what they accomplish at a high level, and how they connect so you can read real programs and plan new ones without memorizing every parameter on day one.
Broadcom groups programming into Environment, Library, and Activity areas. Statements valid in one area may be invalid in another even when the keyword spelling is correct. The overview below lists beginner-critical statements by home section. Advanced topics—SQL, DLI, complex file verbs—extend this core set documented in the full language reference.
| Section | Representative statements | Purpose |
|---|---|---|
| Environment | PARM | Program-wide compile and execute options, LINK name, DEBUG, ABEXIT |
| Library | FILE, DEFINE | Describe files, record fields, working storage |
| Activity — driver | PROGRAM, EXECUTE, STOP | Top-level control of which activities run |
| Activity — JOB | JOB, JOB INPUT, IF, MOVE, ADD, PRINT, WRITE | Record processing, calculations, I/O, report selection |
| Activity — SORT | SORT, SELECT | Ordering records and conditional sort input |
| Activity — modular | PROC, END-PROC, PERFORM | Reusable procedure modules |
| REPORT subactivity | REPORT, TITLE, LINE, CONTROL, SUM | Formatted report layout and breaks |
| Activity — SCREEN | SCREEN, DISPLAY, ACCEPT | Terminal interaction in online programs |
PARM is the flagship Environment statement. It sets defaults for listing generation, debug tracing, abnormal termination handling, link name, and many optional subparameters documented per release. Environment statements appear first so reviewers see global behavior before data definitions. Changing PARM can alter listing content and runtime diagnostics without changing business IF logic.
1PARM LINK(PAYRPT) DEBUG(STATE) ABEXIT(NOSNAP)
FILE introduces a file definition block: organization, record length, and field lines with position, length, and type. DEFINE creates working storage fields separate from record layouts. Macro expansion may inject additional Library statements from COPY members. Every field referenced in JOB IF or REPORT LINE must be defined here or via macro unless it is a system field documented for special use.
JOB opens an activity optionally labeled with NAME. JOB INPUT names the driving file. Between INPUT and the end of executable job logic you code IF, ELSE, END-IF, MOVE, ADD, SUBTRACT, DISPLAY, PRINT, WRITE, READ, DELETE, and database access statements supported in your environment. WHEN EOF and similar constructs handle end-of-file paths. STOP ends program execution when conditions require early exit.
12345JOB INPUT PERSNL NAME PAYRUN IF STATUS EQ 'A' ADD AMOUNT TO WS-TOTAL PRINT AUDIT-RPT END-IF
IF and END-IF bracket conditional execution. CASE provides multi-way branching. DO WHILE and DO UNTIL loop until conditions change. GOTO transfers to labels or JOB/SCREEN tops. EXECUTE starts another activity from PROGRAM. PERFORM calls PROC modules. These statements interact— nesting IF inside DO inside PROC is common when structured properly with indentation.
REPORT names a report and sets options like LINESIZE. TITLE adds heading lines. LINE defines detail columns. CONTROL establishes break fields. SUM requests total fields. SEQUENCE and related report options appear in reporting documentation. Report PROC statements use special labels such as BEFORE-LINE and TERMINATION rather than user-chosen PERFORM targets.
| Procedural (runs in flow) | Declarative (defines structure) |
|---|---|
| IF, PERFORM, MOVE, PRINT, DISPLAY | FILE field lines, REPORT, LINE, TITLE |
| GOTO, EXECUTE, STOP, ADD | CONTROL, SUM on REPORT (define break behavior) |
PRINT sits in procedural job logic but triggers declarative report layout— the bridge between processing and presentation. Misplacing declarative REPORT inside procedural IF blocks causes compile errors because the compiler expects REPORT after job PROCs, not inside the read loop.
Many statements accept parenthesized parameter lists. PARM DEBUG(FLOW) and MASK(A BWZ '$$,$$9.99') require parentheses to group multiple parameters. Omitting parentheses when multiple parameters are required makes the compiler read only the first token as the parameter. Commas inside parentheses improve readability but follow documented optional rules per statement.
123456789101112PARM LINK(DEMO) FILE EMPFILE FB(80 800) EMPID 1 5 N ENAME 6 20 A JOB INPUT EMPFILE PRINT LISTRPT REPORT LISTRPT LINESIZE 80 TITLE 01 'EMPLOYEE LIST' LINE 01 EMPID ENAME
Six statement groups—PARM, FILE layout, JOB INPUT loop body, PRINT selection, REPORT header, LINE layout—produce a compilable listing program. Adding DEFINE, IF filters, PROC modules, and CONTROL breaks extends the same pattern without changing section order rules.
Use this overview to choose which statement page to read next in the tutorial series or Broadcom Language Reference. FILE field syntax leads to field definition topics. IF leads to conditional expressions. REPORT leads to report section and report PROC topics. Compile errors cite statement numbers and keywords—map the keyword back to its section to fix the root cause faster.
Statements are verbs and nouns in instructions. PARM sets house rules. FILE names what is in each box. JOB says what to do with each item pulled from the box. PRINT picks items for the poster. REPORT says how the poster looks. PROC is a helper recipe PERFORM can call. Each sentence type has its place in the instruction manual—you cannot put poster design sentences in the middle of sorting toys unless the manual allows it.
1. FILE and DEFINE statements belong in:
2. JOB INPUT is a statement in:
3. REPORT, TITLE, and LINE are:
4. PARM typically appears in:
5. PERFORM and PROC work together to: