Easytrieve Statements Overview

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.

Progress0 of 0 lessons

Statements Organized by Section

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.

Core statements by program section
SectionRepresentative statementsPurpose
EnvironmentPARMProgram-wide compile and execute options, LINK name, DEBUG, ABEXIT
LibraryFILE, DEFINEDescribe files, record fields, working storage
Activity — driverPROGRAM, EXECUTE, STOPTop-level control of which activities run
Activity — JOBJOB, JOB INPUT, IF, MOVE, ADD, PRINT, WRITERecord processing, calculations, I/O, report selection
Activity — SORTSORT, SELECTOrdering records and conditional sort input
Activity — modularPROC, END-PROC, PERFORMReusable procedure modules
REPORT subactivityREPORT, TITLE, LINE, CONTROL, SUMFormatted report layout and breaks
Activity — SCREENSCREEN, DISPLAY, ACCEPTTerminal interaction in online programs

Environment Statements

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.

text
1
PARM LINK(PAYRPT) DEBUG(STATE) ABEXIT(NOSNAP)

Library Statements

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 Processing Statements

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.

text
1
2
3
4
5
JOB INPUT PERSNL NAME PAYRUN IF STATUS EQ 'A' ADD AMOUNT TO WS-TOTAL PRINT AUDIT-RPT END-IF

Control Flow Statements

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 Statements

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 vs Declarative Classification

Examples by execution model
Procedural (runs in flow)Declarative (defines structure)
IF, PERFORM, MOVE, PRINT, DISPLAYFILE field lines, REPORT, LINE, TITLE
GOTO, EXECUTE, STOP, ADDCONTROL, 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.

Statement Parameters and Options

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.

How Statements Compose a Minimal Program

text
1
2
3
4
5
6
7
8
9
10
11
12
PARM 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.

Finding Statement Details

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.

Common Beginner Confusions

  • Using PRINT without a matching REPORT definition.
  • Coding JOB INPUT before FILE defines the input file.
  • Mixing JCL DD syntax into Easytrieve statements.
  • Expecting REPORT LINE to filter records—use IF and PRINT in JOB logic.
  • Calling PERFORM before PROC is defined at end of activity.

Explain It Like I'm Five

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.

Exercises

  1. Classify ten statements as Library, JOB procedural, or REPORT declarative.
  2. Write a minimal program skeleton with PARM, FILE, JOB, REPORT, LINE.
  3. Explain why PERFORM is not used to invoke REPORT BEFORE-LINE PROCs.
  4. Match IF, EXECUTE, and STOP to their flow effects in one sentence each.
  5. Identify which section owns DEFINE and which owns JOB INPUT.

Quiz

Test Your Knowledge

1. FILE and DEFINE statements belong in:

  • Library section
  • JCL only
  • SYSPRINT
  • Binder control cards

2. JOB INPUT is a statement in:

  • Activity section JOB activity
  • Environment PARM only
  • Report TITLE
  • Link-edit

3. REPORT, TITLE, and LINE are:

  • Declarative report statements in REPORT subactivities
  • JCL DD statements
  • Compile options only
  • Macro invocations only

4. PARM typically appears in:

  • Environment section at program start
  • Middle of JOB loop
  • After END-PROC
  • Only in JCL

5. PERFORM and PROC work together to:

  • Call and define reusable procedure modules
  • Allocate datasets
  • Sort files without keys
  • Replace REPORT
Published
Read time13 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 statement categories and program section alignmentSources: Broadcom Easytrieve Report Generator 11.6 TechDocs, Language Reference, Program SectionsApplies to: Easytrieve statement taxonomy for beginners