Easytrieve Statement Cheat Sheet

Statements are the verbs of Easytrieve—FILE describes data, JOB reads it, IF filters it, REPORT and PRINT shape output. This cheat sheet groups statements by purpose with minimal syntax patterns so you can find the right keyword during development without opening a manual. Placement column reminds whether each statement lives in Library or Activity. For semantics, error messages, and extended examples, follow links to individual statement tutorials. Statement set reflects Broadcom Report Generator 11.6 batch and report focus; online SCREEN statements included for completeness.

Progress0 of 0 lessons

Definition Statements (Library)

Definition statements
StatementSyntax sketchPurpose
PARMPARM options...Compile/runtime options—LIST, DEBUG, COMPAT
FILEFILE name org... / fieldsDeclare file and record layout
DEFINEDEFINE name type...Working storage fields
REPORTREPORT name options / TITLE LINEReport layout definition
MACROMACRO name ... %MACROMacro definition (compile-time)
text
1
2
3
4
5
FILE PAYROLL FB(200 20000) EMP-ID 1 5 N DEFINE WS-TOTAL W 9 P 2 REPORT PAY-RPT LINESIZE 132 LINE 01 EMP-ID WS-TOTAL

I/O and Activity Driver Statements

I/O statements
StatementSyntax sketchPurpose
JOB INPUTJOB INPUT fileBatch read loop on primary file
GETGET fileRead next record (secondary/manual)
PUTPUT fileWrite record to output file
OPENOPEN fileOpen file explicitly when required
CLOSECLOSE fileClose file explicitly
READREAD fileRead variant per release/access method

Control Flow Statements

Control flow
StatementSyntax sketchPurpose
IF / END-IFIF cond ... END-IFConditional execution
ELSEELSE ...Alternative branch
DO / END-DODO WHILE condLoop while true
PERFORMPERFORM procCall PROC
GOTOGOTO labelBranch to label—use sparingly
EXITEXITLeave PROC or loop
STOPSTOPEnd program
SELECT / CASESELECT / WHENMulti-way branch per release

Data Movement and Calculation

Data statements
StatementPurpose
MOVECopy between fields
ADD / SUBTRACTAccumulate numeric fields
COMPUTE / assignmentExpression evaluation where supported
VALUE on DEFINEInitialize working storage

Report Statements

Report activity and layout
StatementPurpose
PRINTEmit lines from named REPORT layout
TITLEPage header lines inside REPORT
LINEDetail or heading row columns
FOOTINGPage footer lines
SKIPVertical spacing lines
CONTROLField attribute for control breaks
BEFORE-LINE / AFTER-LINEReport event PROC hooks
BEFORE-BREAK / AFTER-BREAKControl break PROC hooks

Sort and Environment

Sort and utility
StatementPurpose
SORTOrder records by keys ascending/descending
SORT control fieldsDUPLICATES, DYNALLOC per syntax
DISPLAYDebug output to listing or log
CALLInvoke external program
LOOKUPTable search patterns per release

Screen Statements (Online)

Screen family
StatementPurpose
SCREENOnline activity block
BEFORE-SCREENPre-display PROC
AFTER-SCREENPost-input PROC
INITIATION / TERMINATIONSCREEN start/end hooks

Minimal Batch Skeleton

text
1
2
3
4
5
6
7
8
PARM LIST FILE FILE INFILE ... REPORT RPT1 ... JOB INPUT INFILE IF condition PRINT RPT1 END-IF STOP

Statement Selection Guide

  1. Need record layout? → FILE (+ macro if shared).
  2. Need scratch field? → DEFINE.
  3. Need read all records batch? → JOB INPUT.
  4. Need filter? → IF.
  5. Need printed columns? → REPORT + PRINT.
  6. Need subtotals? → CONTROL on REPORT field + break PROCs.
  7. Need order by key? → SORT.
  8. Need reuse logic? → PROC + PERFORM.

Common Statement Mistakes

  • PRINT before REPORT defined.
  • JOB INPUT without matching FILE and DD.
  • Missing END-IF, END-PROC, END-DO terminators.
  • REPORT name typo versus PRINT name.
  • GET without EOF handling.

Explain It Like I'm Five

Statements are action cards. FILE card describes the box of records. JOB card says read every record. IF card says only do the next cards when a rule matches. REPORT card draws the paper template; PRINT card actually puts words on paper for this record. The cheat sheet is all action cards sorted by type so you pick the right card fast.

Exercises

  1. Classify ten statements into Library versus Activity.
  2. Write skeleton for read-all print-one-report program.
  3. Add SORT and CONTROL to skeleton on paper—where do they go?
  4. Match I/O statements to scenario: secondary file read.
  5. Find one screen-only statement and explain batch alternative.

Quiz

Test Your Knowledge

1. FILE belongs in:

  • Library section
  • JCL only
  • SYSPRINT
  • Load module

2. JOB INPUT primarily:

  • Drives batch read loop on named file
  • Defines report titles only
  • Links COBOL
  • Compiles macros

3. REPORT versus PRINT:

  • REPORT defines layout; PRINT selects layout during activity
  • Same statement
  • PRINT defines FILE
  • REPORT opens JCL

4. PROC END-PROC wraps:

  • Named reusable procedure code
  • JCL procedures only
  • DD statements
  • Sort cards

5. SORT statement:

  • Orders records by keys
  • Opens SYSPRINT
  • Defines SCREEN
  • Replaces FILE
Published
Read time18 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve Report Generator 11.6 statement catalogSources: Broadcom Easytrieve 11.6 Language Reference statements indexApplies to: Easytrieve statement quick reference