Easytrieve Runtime Errors Index

Runtime errors strike after compile succeeded—when the job reads a truncated record, divides by zero in a packed field, hits end of file on the wrong pass, or VSAM returns a status your program never handles. The listing was clean yesterday; today production data includes one bad row and the step abends S0C7 at statement 000412. Operators see RC 12; developers need FILE-STATUS, statement numbers from STATE option, and the compile listing cross-reference. This index explains execution-phase failure families, how runtime messages differ from EZTC compile codes, abend and dump artifacts, FINISH DISPLAY patterns for operations, and triage when logic versus data versus JCL is at fault. Use compiler errors index when the compile step fails; use this page when the run step fails.

Progress0 of 0 lessons

Compile Success Versus Runtime Failure

A clean compile proves source syntax and static semantics only. Runtime exercises real datasets, concurrent job schedules, empty GDGs, keys not found on VSAM READ, and numeric fields that contain spaces or LOW-VALUES from upstream extracts. Move mode versus locate mode file processing in 11.6 changes invalid reference symptoms—see migration notes when porting 6.4 programs. Always verify the run used the load module you just linked.

Runtime Message and Abend Anatomy

text
1
2
3
4
EZT nnnn message text on SYSPRINT FILE-STATUS = 23 (VSAM not found example — verify against your FILE doc) CEE3204S S0C7 Data exception during ADD Last statement executed: 000412 per STATE listing correlation

Prefixes vary by release and environment. Correlate message text with abend code in job log. When STATE was enabled at compile via PARM DEBUG STATE, abend summaries reference statement numbers matching the compile listing—essential for macro-heavy programs.

File and I/O Error Family

Common file-related runtime failures
SymptomLikely causeFirst check
OPEN failureMissing DD, wrong DSN, DISP conflictJCL DD and catalog
READ EOF unexpectedEmpty file, wrong SORT orderDataset row count; JOB INPUT logic
VSAM status 23Record not found on direct readKEY value; PATH-ID for path calls
Wrong amounts on reportLayout mismatch not abendDMAP versus actual LRECL; RECORD-LENGTH for variable
MTVSERR empty VSAMEmpty cluster when reads expectedMTVSERR execution option; file prep job

System-defined FILE-STATUS, RECORD-COUNT, RECORD-LENGTH, and PATH-ID fields document runtime file state. Test FINISH procedures that DISPLAY status when any GET returns error—operations need plain language, not only abend codes.

Arithmetic and Data Exception Family

S0C7 data exception often traces to ADD or SUB on packed fields with invalid nibbles— spaces in zoned fields, HIGH-VALUES in amounts, or divide by zero when divisor never validated. Guard with IF NUMERIC and IF field NE ZERO before math. SQL nullable fields need indicator checks before arithmetic. FLDCHK compile option catches some invalid references early but does not replace data validation.

text
1
2
3
4
5
6
IF DIVISOR NUMERIC AND DIVISOR NE ZERO QUOTIENT = DIVIDEND / DIVISOR ELSE MOVE ZERO TO QUOTIENT MOVE 'Y' TO ERR-FLAG END-IF

SORT and Utility Runtime Failures

SORT activity invokes system sort. Wrong key length, unsupported format, insufficient work space, or missing SORTWK DD produce sort messages in SYSPRINT wrapped in Easytrieve step output. SORT(MSG(ALL)) on PARM surfaces detail during test. Keys must match defined file fields; binary keys need correct length in SORT statement. External presort jobs that omit sync with Easytrieve FILE layout cause silent wrong order—not always an error message.

Application RETURN-CODE Versus Abend

MOVE 8 TO RETURN-CODE in FINISH exits cleanly with RC 8—batch scheduler may still alert. Distinguish from S0C4 protection exception. Document intentional RETURN-CODE values in runbooks: 0 success, 4 warning, 8 business validation failure, 12 severe. DISPLAY explanatory text before STOP so logs show reason without dump reading.

Online and CICS Runtime Considerations

SCREEN activities may fail on map errors, missing terminal definitions, or EXECUTE nesting mistakes recursion cannot detect. CICS programs must remain conversational when CALL chains require it. Transaction dumps differ from batch CEEDUMP. AFTER-SCREEN validation should set message fields instead of abending when operator correctable.

Debugging Aids for Runtime

Runtime diagnostic tools
AidPurpose
PARM DEBUG STATEStatement number at failure
PARM ABEXIT SNAPStorage dump on abend—dev only
DISPLAY tracingBranch and field snapshots
FLOW / TRACEIN optionsStatement flow trace—high overhead
Compile listing XREFMap statement number to source
FILE statistics LISTFILI/O counts at end of step

Triage Workflow

  1. Identify failing step: compile, link, or run—this index is for run.
  2. Read job log abend code and SYSPRINT last messages.
  3. If S0C7, dump or listing STATE points to statement; inspect fields in DMAP.
  4. If file status, log DD name, DSN, DISP, and key values (non-PII in tickets).
  5. Reproduce with small test file; add DISPLAY guards.
  6. Compare load module date to source; rule out stale bind.
  7. Document fix: data cleanse, validation IF, JCL DD, or layout correction.

Common Runtime Mistakes

  • Assuming compile clean means data clean.
  • Leaving ABEXIT SNAP in production JCL.
  • Ignoring FILE-STATUS after GET READ.
  • No FINISH DISPLAY when RETURN-CODE non-zero.
  • Chasing SORT without verifying key field offsets.
  • Editing copybook without recompile and relink.

Explain It Like I'm Five

Runtime errors happen when the robot tries to do the homework on real papers, not practice sheets. Maybe a page is torn (bad data), the folder is empty (EOF), or the robot tries to divide cookies among zero friends (divide by zero). The compile step only checked spelling; runtime checks whether the world outside makes sense. The job log is the robot's cry for help—read what it says before opening every toolbox.

Exercises

  1. Write FINISH DISPLAY for FILE-STATUS and RETURN-CODE.
  2. List three differences between S0C7 and RETURN-CODE 8.
  3. Describe when SORT(MSG(ALL)) helps versus hurts.
  4. Plan DISPLAY trace points for one JOB INPUT loop.
  5. Explain why wrong salary on report may not abend.

Quiz

Test Your Knowledge

1. Runtime errors occur during:

  • Program execution after successful compile
  • Source editing only
  • JCL catalog
  • MACRO authoring

2. S0C7 abend usually indicates:

  • Data exception in numeric operation
  • Successful end
  • JCL syntax error
  • Missing DD only

3. FILE-STATUS after failed READ helps determine:

  • Dataset or key problem versus logic
  • Compiler version
  • Macro library name
  • TITLE mask

4. RETURN-CODE set in FINISH to 8 means:

  • Application chose non-zero return; not always system abend
  • Always S0C4
  • Compile failed
  • JES down

5. PARM DEBUG STATE helps runtime diagnosis by:

  • Saving statement numbers for abend tracebacks
  • Deleting files
  • Disabling SORT
  • Uppercasing titles
Published
Read time14 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 execution options, FILE processing, best practices debuggingSources: Broadcom Easytrieve 11.6 Execution Options, File Processing Fields, Using Best PracticesApplies to: Easytrieve runtime errors and abends