Easytrieve Statements Reference

Every Easytrieve program is a structured conversation between statements. PARM whispers compile and runtime options. FILE and DEFINE describe data shapes in Library. JOB opens the workday—INPUT file, READ loop, IF filters, PRINT to report. REPORT subactivity declares TITLE and LINE so output looks professional. STOP ends the shift. The Language Reference documents hundreds of statements with parameters beginners cannot absorb in one sitting. This reference page is the map: alphabetical index from ACCESS through WRITE, each entry linking to a dedicated tutorial with syntax, examples, quizzes, and mistake lists. Use it when you know the statement name from an error message or colleague's source but not what it does or where it belongs. Pair with statements overview for section-based mental model—Environment versus Library versus Activity—and with statements by category for functional grouping by I/O, control flow, and reporting.

Progress0 of 0 lessons

How to Use This Reference

Search alphabetically below when debugging compile errors like unknown statement or invalid context for FILE. Click the statement name when tutorial page exists; pages under construction appear in checklist order. Read section column before coding—FILE in middle of JOB body fails even when spelling correct. Cross-check terminator rules on statement-specific page and statement terminators tutorial. Vendor manual remains authority for obscure options; tutorials teach durable patterns and beginner traps.

Statement Categories at a Glance

Functional families
FamilyExamplesRole
DefinitionFILE, DEFINE, TABLEDescribe data in Library
I/OOPEN, READ, GET, WRITE, CLOSEMove records
Control flowIF, DO, WHILE, GOTO, CASEBranch and loop
ReportingREPORT, TITLE, LINE, PRINTFormat output
ModularPROC, PERFORM, CALL, RETURNReuse logic
EnvironmentPARMProgram-wide options

Minimal Batch Program Statement Set

Smallest useful payroll filter uses subset of full index. Environment PARM optional. Library FILE and DEFINE mandatory. Activity JOB INPUT, DO WHILE or READ loop, IF, PRINT, STOP. REPORT with TITLE and LINE at JOB end. Every other statement in index extends this skeleton—SORT before JOB, DISPLAY for debug, ADD for running totals, WRITE for extract file instead of report.

text
1
2
3
4
5
6
7
8
9
10
11
12
PARM FILE PAYROLL FB(80 800) EMP-NO 1 6 N GROSS 20 5 P 2 JOB INPUT PAYROLL IF GROSS GT 0 PRINT PAY-RPT END-IF STOP * REPORT subactivity follows JOB in same activity

Procedural Versus Declarative Statements

Procedural statements execute in sequence during runtime—READ, IF, ADD, PRINT. Declarative statements register structure compiler uses later—REPORT, LINE, FILE field layout. Mixing order violates grammar: REPORT definitions belong after JOB executable statements in same activity. BEGINners paste TITLE at top of program like HTML header—compile error. Index section column marks declarative report and library entries versus procedural activity verbs.

Alphabetical Statement Index

Each row summarizes purpose and home section. Tutorial links use slug under /tutorials/easytrieve/statements/. Pages marked pending in checklist will link as they publish—bookmark this reference for updates.

Statements A–W
StatementSectionPurpose
ACCESSActivity / fileAccess indexed or relational data per grammar
ADDActivityAdd numeric value to field or accumulator
AFTER-BREAKReport eventsLogic after control break processing
AFTER-LINEReport eventsLogic after each detail line prints
AFTER-SCREENScreenLogic after screen display or input
BEFORE-BREAKReport eventsLogic before control break output
BEFORE-LINEReport eventsLogic before detail line prints
BEFORE-SCREENScreenLogic before screen presentation
CALLActivityInvoke external program or routine
CASEActivityMulti-way branch on value
CLOSEActivityClose file after processing
DISPLAYActivityWrite diagnostic line to SYSPRINT
DOActivityStart loop block with END-DO
ELSEActivityAlternative branch for IF
ENDVariousClose block or activity per context keyword
END-IFActivityClose IF conditional block
FILELibraryDeclare file and record organization
GETActivityRead keyed or relative record
GOTOActivityTransfer control to label
IFActivityConditional execution of statements
JOBActivityStart job activity with INPUT and logic
LABELActivityNamed target for GOTO or PERFORM
LINEReportDefine detail column layout on report
LOOKUPActivityTable or file lookup processing
MACROLibrary / compileMacro definition or invocation
MOVEActivityMove or assign field values
OPENActivityOpen file for I/O
PARSEActivityParse delimited or structured text
PRINTActivitySelect record for report output
PROCActivity / reportDefine procedure module END-PROC
READActivityRead next sequential record
REPORTReportStart report subactivity definition
RETURNActivityReturn from called routine
SCREENScreenDefine online screen layout
SELECTActivitySelect records meeting criteria
SORTActivitySort file by keys
STARTActivityStart browse or processing verb
STOPActivityTerminate program execution
TABLELibraryDefine in-memory table
TITLEReportReport page or section heading lines
TOTALReportReport total processing
WHILEActivityLoop while condition true
WRITEActivityWrite record to output file

Statements With Paired End Keywords

  • IF requires END-IF—or period grammar on older styles per release.
  • DO requires END-DO; DO WHILE combines condition with loop body.
  • PROC module ends with END-PROC; distinguish from job PROC call.
  • REPORT subactivity ends before next REPORT or job PROC per placement rules.
  • CASE branches require END-CASE or equivalent per manual.

Execution Order Within JOB

  1. JOB INPUT selects driver file.
  2. OPEN implicit or explicit before READ.
  3. Loop READ or GET retrieves records.
  4. IF and calculations filter and transform.
  5. PRINT selects for report; WRITE sends to extract file.
  6. CLOSE when processing complete.
  7. Report writer formats PRINT-selected rows using REPORT defs.

Common Cross-Statement Mistakes

  • FILE after JOB started—must be Library.
  • PRINT without REPORT definition for named report.
  • IF without matching END-IF confusing maintainer and compiler.
  • LINE field names not in DEFINE.
  • SORT keys not matching FILE field offsets.
  • STOP missing—program falls through unpredictably.

Explain It Like I'm Five

Statements are sentence types in Easytrieve language. Nouns like FILE say what data looks like. Verbs like READ and PRINT say what actions happen. Conjunctions like IF say when to do something. This reference is the dictionary listing every sentence type alphabetically so you can look up READ when you see it in someone else's program and learn what it does.

Exercises

  1. Pick five statements from index and classify procedural versus declarative.
  2. Sketch minimal batch using only PARM FILE DEFINE JOB IF PRINT STOP.
  3. Explain why FILE cannot appear inside IF block.
  4. Find three paired end keywords in index list.
  5. Contrast this reference with statements overview in one paragraph.

Quiz

Test Your Knowledge

1. Easytrieve statements are grouped in source by:

  • Environment, Library, and Activity sections
  • Alphabetical order required
  • JCL order only
  • Random placement

2. FILE and DEFINE are:

  • Library section data definition statements
  • REPORT TITLE lines
  • JCL DD only
  • Macro invocations

3. IF and END-IF bracket:

  • Conditional procedural logic in Activity section
  • Environment PARM only
  • Link-edit attributes
  • SCREEN maps only

4. REPORT TITLE LINE belong to:

  • REPORT subactivity at end of JOB
  • Start of Library
  • JCL EXEC
  • Binder input

5. This statements reference page differs from statements overview by:

  • Alphabetical index to every statement tutorial
  • Covering JCL only
  • Replacing Language Reference parameters
  • Listing only arithmetic
Published
Read time18 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 Language Reference statement listSources: Broadcom Easytrieve Report Generator 11.6 Language Reference, EZT Plus 6.3 statement indexApplies to: Easytrieve statement reference and navigation