Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Debugging user exits

To debug a user-exit routine, use the debugger on the main compiler module, not on COB2.EXE. (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 and links it:

    cob2 -q“EXIT(ADEXIT(IWZRMGUX))” pgmname.cbl

    Modify this command as follows:

    cob2 -# -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
    ilink  /free /nol /pm:vio pgmname.obj
  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.


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)