Easytrieve Compile Process

Compilation transforms Easytrieve source—FILE, REPORT, ACTIVITY, SCREEN, and PROC statements—into object code the runtime can execute. The process is triggered by JCL executing EZTPA00, governed by PARM lines and the options table, and documented on SYSPRINT for every developer fixing errors. This page walks through phases from SYSIN bytes to load module handoff so beginners understand what the compiler actually does.

Progress0 of 0 lessons

Compile Process Overview

  1. JCL starts EZTPA00 with STEPLIB, EZOPTBL/EZTINI, EZTVFM, SYSPRINT, SYSIN.
  2. Compiler reads options table defaults and PARM statements from SYSIN stream.
  3. Library section parsed—files, fields, working storage, procedures registered.
  4. Activity, Report, Screen sections parsed and cross-checked against Library.
  5. Syntax and semantic validation—undefined fields, invalid statement combinations.
  6. Code generation—object instructions for runtime report and file services.
  7. Output—listing on SYSPRINT; object on SYSLIN or direct execution if compile-and-go.
  8. Optional IEWL link-edit creates load module in SYSLMOD library.

PARM Statements Control the Compile

PARM is not optional metadata—it switches compiler mode. Examples from Broadcom workflows:

Common PARM modes (consult Language Reference for full list)
PARMEffect
SYNTAXValidate syntax; quick check without full object build
COMPILEFull compile; object to SYSLIN for later link
LINK(name)Compile and link module name for load library
COMPATEnable compatibility behaviors for migrated 6.4 code

PARM may appear as the first statement in SYSIN before FILE statements. Shop standards sometimes inject PARM via proc skeleton so developers never omit it.

Phase 1: Library Analysis

The compiler reads FILE definitions first, building a dictionary of record layouts: start position, length, type (A alphanumeric, N numeric, P packed decimal, etc.), and file attributes. W fields (working storage) and PROC definitions register next. Errors here— overlapping fields, invalid lengths—cascade into later sections. Fix Library before debugging REPORT logic.

Phase 2: Statement Validation

Activity statements (IF, READ, SORT, PERFORM, CALL) and Report statements (LINE, CONTROL, SUM, TITLE) reference fields from Library. The compiler verifies:

  • Field names exist and types compatible with operations (numeric vs alpha compares).
  • Report names referenced in JOB or activity exist in REPORT section.
  • Control fields suitable for CONTROL breaks (often need sorted input).
  • SQL FILE definitions include valid table/view references when using Plus SQL.

Phase 3: Code Generation

Validated program transforms to object code—machine instructions plus metadata for Easytrieve runtime services (buffer management, report formatting engine, sort calls). You do not see assembler source unless options request low-level listing; most developers interact only with SYSPRINT summary and error messages.

On z/OS, object goes to SYSLIN for binder input. On distributed platforms per Broadcom docs, object format differs and EZT command may auto link-edit for standalone executables.

Reading the Compile Listing

Sections to scan

  • Source listing — your code with sequence numbers and error markers (E, W).
  • Message section — EZT#### messages with severity and explanation text.
  • Cross-reference — which procedures and fields are used where.
  • Summary — highest severity, statement counts, estimated storage.

Severity E (error) prevents successful compile unless options allow warnings-only proceed. W (warning) flags suspicious but legal constructs—review during migration.

Sample Source with PARM

text
1
2
3
4
5
6
7
8
9
PARM COMPILE FILE EMPLOYEE EMP-ID 1 6 N EMP-NAME 7 30 A EMP-SALARY 37 7 P 2 REPORT SALRPT TITLE 'Employee Salary Listing' LINE EMP-ID EMP-NAME EMP-SALARY

PARM COMPILE tells EZTPA00 to produce linkable object without running the report. Omit PARM or use compile-and-go JCL to execute after compile. TITLE and LINE define report layout validated during Report section processing.

Compile-Only vs Compile-and-Go Decision

When to use each compile outcome
ModeUse when
Compile-only + linkProduction promotion, change control, repeat execution
Compile-and-goDevelopment test, ad hoc, small data verification
SYNTAX onlyPre-commit check in edit workflow

Interaction with Options Table

Before parsing source, compiler loads options from EZOPTBL or EZTINI default. Options may set default listing width, compatibility flags, SQL behavior, and diagnostic level. Global options reduce repetitive PARM coding but can surprise developers when a global flag differs from 6.4 expectations—document options changes in migration run books.

After Compile: Link-Edit

Object in SYSLIN is not executable until IEWL binder resolves external references to Easytrieve runtime routines in CBAALOAD and writes a load module. The load module name comes from PARM LINK(name). Execute step uses PGM=name with STEPLIB concatenation described in JCL execution tutorial.

Common Compile Errors (Beginners)

  • Undefined field — typo or missing FILE/W declaration.
  • Invalid statement order — REPORT before Library complete in some error cases.
  • Type mismatch — compare packed field to alpha literal without edit.
  • Missing EZOPTBL/INI — environment error masquerading as compile failure.
  • Macro not found — PANDD DD missing or wrong macro library.

Explain It Like I'm Five

Compiling is translating your Easytrieve recipe into machine instructions the kitchen robot understands. The compiler reads the recipe (SYSIN), checks you did not ask for sugar in the soup by mistake (errors), writes a note about problems (SYSPRINT), and gives the robot a card to follow (object code). Link-edit puts that card in the right folder (load library) so the batch job can find it tomorrow night.

Exercises

  1. Submit a PARM SYNTAX job against a member with a deliberate typo; find message on SYSPRINT.
  2. Identify Library, Report sections in a sample program and predict compile order.
  3. Compare listing sections after successful compile vs failed compile.
  4. Explain path from SYSLIN object to executable PGM= module.
  5. List three global options that might live in EZOPTBL instead of source PARM.

Quiz

Test Your Knowledge

1. The Easytrieve compiler is invoked when JCL runs PGM=

  • EZTPA00
  • IEFBR14
  • SDSF
  • ISPF

2. PARM SYNTAX is used to:

  • Check source without full compile
  • Execute CICS
  • Format DASD
  • Bind Db2 plan

3. Compiler output object for linking goes to:

  • SYSLIN DD
  • SYS1.PARMLIB
  • JES2 intradata
  • CICS TDQ

4. The compile listing appears on:

  • SYSPRINT
  • SYSIN
  • SYSABEND only
  • Master catalog

5. Undefined field errors usually mean:

  • Field used before Library section declaration
  • JCL REGION too small only
  • Wrong tape label
  • CICS not up
Published
Read time11 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Compile and Link Your Program 11.6 TechDocsSources: Broadcom compilation results docs, Program Compilation JCL, Language Reference PARMApplies to: Easytrieve 11.6 compile on z/OS