Debugging user exits

To debug a user-exit routine, use the debugger on the main compiler module, not on cob2. (The main compiler module is a separate process started by cob2, and the debugger can debug only one process.)

Do these steps:

  1. Use cob2 with the -# option to see how cob2 calls the main compiler module and what options it passes. For example, the following command compiles pgmname.cbl with the IWZRMGUX user exit:
    cob2 -c -q"EXIT(ADEXIT(IWZRMGUX))" pgmname.cbl

    Modify this command as follows:

    cob2 -# -c -q"EXIT(ADEXIT(IWZRMGUX))" pgmname.cbl

    As a result, you will see this (IGYCCOB2 calls your user exit):

    IGYCCOB2 -q"EXIT(ADEXIT(IWZRMGUX))" pgmname.cbl
    
  2. Debug the user exit as follows:
    idebug IGYCCOB2 -q"EXIT(ADEXIT(IWZRMGUX))" pgmname.cbl

The debugger automatically stops at the beginning of the user exit, provided that you built the exit with debug information.