The Easytrieve runtime process is the execution side of the language. Compilation checks source and produces code; runtime is when JCL starts that code, DD statements are allocated, input records are read, reports are written, and condition codes are returned to the scheduler. Beginners often blur these phases together because compile-and-go jobs can compile and run in one submission. In production, however, understanding runtime is essential because many failures are not language errors at all. They are allocation, data, library, or operational problems that only appear after the program starts.
A typical Easytrieve runtime step follows a predictable chain. JES reads the submitted JCL, z/OS allocates the files named by DD statements, the program and Easytrieve runtime services are loaded from the STEPLIB or link-list path, and control transfers to the generated Easytrieve code. The code initializes working fields, opens files, runs the JOB activity, prints reports, closes resources, writes diagnostics, and returns a condition code.
In a compiled production flow, the JCL step normally runs a load module created earlier by the compiler and binder. That load module does not contain every service it needs. It relies on Easytrieve runtime routines for file handling, report formatting, sorting, and environment services. Those routines are found through STEPLIB, JOBLIB, LNKLST, or a site-specific product library.
This is why two programs with identical source can behave differently across regions. Test may point STEPLIB to one Easytrieve maintenance level while production points to a newer library. Runtime library mismatch can produce missing module errors, option differences, or subtle compatibility behavior. A good operations checklist records the program library, runtime library, and product release together.
Easytrieve source uses logical file names. JCL connects those names to physical datasets with DD statements. If the source says FILE PERSNL, the runtime expects a DD named PERSNL unless the shop has wrapper procedures or dynamic allocation conventions. A compiled program can be perfect and still fail because the dataset was deleted, the DD name is misspelled, the disposition is wrong, or the LRECL does not match the program assumptions.
12345//RUNRPT EXEC PGM=PAYRPT //STEPLIB DD DSN=PROD.EASYTRIEVE.LOADLIB,DISP=SHR //PERSNL DD DSN=PROD.HR.PERSONNEL,DISP=SHR //SYSPRINT DD SYSOUT=* //PAYOUT DD SYSOUT=*
In this example, PERSNL is the business input file. SYSPRINT receives messages and diagnostics. PAYOUT might receive a report if the program or site procedure directs report output there. At runtime, z/OS resolves these DD statements before Easytrieve can process records. Missing DD names fail early because the runtime cannot open the file.
Easytrieve is popular because a simple JOB INPUT statement hides the repetitive read loop that COBOL programmers usually write by hand. With JOB INPUT PERSNL, the runtime opens PERSNL, reads the first record, executes the activity statements, reads the next record, and repeats until end of file. At EOF, it finishes reports, closes files, and ends the step.
1234567891011121314FILE PERSNL FB(150 1800) EMPNAME 17 8 A EMPNO 9 5 N DEPT 98 3 N GROSS 94 4 P 2 JOB INPUT PERSNL IF DEPT = 911 PRINT PAY-RPT END-IF REPORT PAY-RPT LINESIZE 80 TITLE 01 'PERSONNEL REPORT' LINE 01 DEPT EMPNAME EMPNO GROSS
The important runtime idea is that IF logic runs once per input record. PRINT does not immediately write a finished page in the way a beginner might imagine. It passes detail information to the report writer, which manages headings, line counts, page numbers, breaks, and totals according to the REPORT definition.
At startup, working storage fields receive their defined initial values or product defaults. Counters begin at zero, report page state is reset, and buffers are prepared. During processing, every record may update working fields, accumulate totals, or trigger a report line. That state lives only for the job step unless the program writes it to an output file. Restarting the job starts the runtime state over unless restart logic uses checkpoints or input positioning outside Easytrieve.
| Runtime state | What it affects |
|---|---|
| Current input record | The field values visible to IF, calculations, and PRINT for this loop pass |
| Working fields | Temporary values such as counters, flags, totals, and reformatted output |
| Report page state | Current line, page number, titles already printed, and pending breaks |
| File status | Whether input and output files opened, read, wrote, and closed correctly |
Compile errors are discovered before execution: invalid syntax, undefined field names, missing END-IF statements, incompatible options, or invalid report references. Runtime errors are discovered while processing real data and real JCL. This distinction matters because the fix may belong to a developer, scheduler, storage team, security team, or data provider.
At the end of a runtime step, operations watches the condition code. A zero return code normally means the program ended successfully. A warning or error return code means the job ended but something requires attention. An abend means the step ended abnormally, often with system or user abend information. The exact meanings are site-specific, so beginners should read the message text rather than assuming every RC 4 or RC 8 has the same business meaning.
| Outcome | How to read it |
|---|---|
| RC 0 | Normal completion, but still verify expected report counts |
| Warning RC | Completed with a condition the shop may tolerate or investigate |
| Error RC | Logic, data, allocation, or business validation problem likely affected output |
| Abend | Abnormal termination; inspect JES messages, dumps, and Easytrieve diagnostics |
Start from the outside and move inward. First confirm the JCL step that failed. Then read JES allocation messages to see whether DD statements resolved. Next read SYSPRINT for Easytrieve diagnostics. If the program processed some records, use record counts, report totals, DISPLAY lines, or last successful output to locate the data region where failure occurred. Resist changing source before proving the source caused the problem.
Runtime performance depends on data volume, file organization, buffering, sort volume, report output size, and CPU-heavy calculations. A report that runs quickly against one department may slow down when the input changes from one million records to one hundred million. Easytrieve hides much of the loop code, but it cannot remove I/O cost. Reading fewer records, sorting only necessary fields, using correct input order for control breaks, and avoiding unnecessary PRINT calls are practical beginner optimizations.
Think of compilation as writing instructions for a toy train. Runtime is the moment the train actually runs on the track. The track must be connected, the batteries must work, the stations must have names, and the train must carry the right cars. If the track is broken, the instructions can still be correct, but the train will stop. Easytrieve runtime is the train ride: files are tracks, records are passengers, and SYSPRINT tells you where the train stopped if something went wrong.
1. The Easytrieve runtime begins after:
2. JOB INPUT primarily controls:
3. A missing input DD usually causes:
4. SYSPRINT is commonly used at runtime for:
5. A non-zero return code means: