Debugging Easytrieve programs means separating compile-time problems from runtime problems—and using the right artifact for each. A missing END-IF fails compile with a listing message pointing to statement number. Wrong DEPT totals may compile cleanly while reading bad offsets from an outdated macro expansion baked into the load module. Online SCREEN programs fail validation paths operators never exercise in batch testing. This section overview maps the debugging toolkit: compiler listings for syntax and macro expansion, tracing execution paths, DISPLAY for field snapshots, dump analysis when the region abends, and disciplined test data so you reproduce bugs in minutes not days. Beginners often change random logic when the FILE definition is wrong; systematic debugging verifies assumptions in order—compile clean, data correct, logic correct, environment correct. Use this page as the roadmap before diving into compiler listings, tracing, dump analysis, DISPLAY debugging, and test data tutorials.
| Phase | Symptoms | Primary tool |
|---|---|---|
| Compile / preprocess | Non-zero compile RC, no load module | Compiler listing, macro expansion |
| Runtime batch | Abend, empty report, wrong totals | DISPLAY, dumps, output compare |
| Runtime online | Wrong screen, validation loops, terminal errors | Screen trace, AFTER-SCREEN DISPLAY, CICS diagnostics |
Capture JCL, program source level, macro library level, and input record counts. Without reproduction, fixes are guesses.
Compile failure? Go to listing. Clean compile with wrong output? Suspect data, FILE layout, or logic order.
Binary search the program: comment half the IF filters, run on tiny test file, see if error persists. Add DISPLAY at branch entry points.
Apply minimal fix; rerun same test JCL; expand to integration test before production promote.
Strip DISPLAY and trace hooks before production compile—leftover debug floods operations logs.
| Category | Example | First check |
|---|---|---|
| Syntax | Missing END-IF | Listing error line |
| Macro expansion | Bad DEFINE after %PERSNL | Expansion listing |
| File layout | DEPT reads wrong columns | FILE offsets vs dictionary |
| Logic | Filter excludes all records | DISPLAY DEPT before IF |
| Data | Empty input file | IDCAMS/listcat or record count |
| JCL | Wrong DD pointing at old file | JCL listing and DISP |
123456JOB INPUT PERSNL DISPLAY 'REC=' EMP# ' DEPT=' DEPT IF DEPT = 911 DISPLAY 'SELECTED EMP=' EMP# PRINT PAY-RPT END-IF
Temporary DISPLAY lines show which records enter selection. Compare counts to expected. Remove DISPLAY after fix—see display-debugging page for options and output destinations.
Program compiled months ago; macro library changed yesterday; load module still has old expansion. Symptom looks like logic bug but is stale object module. Compare compile date of load to macro promotion date. Force recompile after library updates—tie to macro reuse governance from prior section.
AFTER-SCREEN is natural place for DISPLAY of operator input fields. Pair with message field content and cursor position tutorials. Pseudo-conversational programs may need CICS trace alongside Easytrieve DISPLAY depending on deployment.
Your shop may add Fault Analyzer, File Manager compare, or Easytrieve IDE breakpoints. This tutorial section focuses on facilities in every Easytrieve installation—listings, DISPLAY, dumps, test files—before optional vendor tools.
Macros section taught expansion listings—first macro debug skill. File processing tutorials explain EOF and file status—verify before blaming IF logic. Control flow pages map IF and PERFORM—DISPLAY at branch labels clarifies path taken. Compile process page orients where listing fits in build pipeline.
Debugging is finding why your toy train stopped. Compile errors mean you built the track wrong— read the instruction booklet (listing). Runtime errors mean the track is built but a bridge is missing—walk the train path (DISPLAY) and look where it falls off (dump). Test data is a small practice track before running the big layout.
1. Compile errors are fixed by:
2. Runtime errors often need:
3. DISPLAY statement during debugging:
4. After macro library change, first debug step is often:
5. Good test data strategy includes: