Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 11: CICS Error Handling and Debugging


CEDF Debugging

CEDF is the CICS Execution Diagnostic Facility - the interactive debugger built into CICS. It stops your program before each EXEC CICS command, shows you the command, the EIB values, and your working storage, and lets you step through one command at a time. When a program abends and you do not know why, CEDF is the first tool to reach for.

Starting and stopping CEDF

  • At a CICS terminal, type CEDF,ON and press ENTER. CEDF is now armed for your terminal.
  • Next, start your transaction normally. CEDF intercepts it and shows its first screen before your program's first CICS command.
  • Type CEDF,OFF to switch it off again. Always switch it off when done so later transactions run normally.
  • The program must be defined with CEDF(YES) for CEDF to intercept it. Check the PROGRAM definition with CEDA if CEDF does not trigger.

What the CEDF screens show

  • Each stop shows the next EXEC CICS command about to run, with its options and your data values.
  • After the command runs, CEDF shows the response: EIBRESP, EIBRESP2, and any condition raised.
  • You can display working-storage fields, the EIB, and the COMMAREA to check values at each step.
  • Pressing ENTER runs the displayed command and stops at the next one. This stepping is how you find the exact failing statement.

Example: CEDF session flow

  • A typical debugging session looks like this - type these at the terminal:
    CEDF,ON (arm the debugger for this terminal) CUST (start your transaction - CEDF intercepts it) -- CEDF shows: EXEC CICS RECEIVE MAP('CUSTMAP') ... ENTER (run it, stop at next command) -- CEDF shows: EXEC CICS READ FILE('CUSTFILE') ... ENTER (run it - watch EIBRESP after the read) -- If EIBRESP shows NOTFND here, you found the bug: -- the program has no handling for a missing record. CEDF,OFF (switch the debugger off when done)

CEDF tips for faster debugging

  • Reproduce the abend first without CEDF and note the abend code. Then reproduce under CEDF to find the statement.
  • Watch EIBRESP after each command. The first non-zero value marks the failing command.
  • Check EIBCALEN at program start. Zero means first-time entry (no COMMAREA); non-zero means a pseudo-conversational return.
  • If HANDLE ABEND hides the failure, issue HANDLE ABEND CANCEL in a test copy so CEDF shows the real abend point.
  • Never leave CEDF ON in a production region on a shared terminal. Switch it OFF when you finish.





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant