Coordinating Listing Options with Debug View Options

Correcting run-time errors often involves debugging a program. The following considerations may help you when you go to debug your program:
  • If you use the source debugger to debug your program you have a choice of debug views: *STMT, *SOURCE, *LIST, *COPY, *ALL.
  • If you plan to use a compiler listing as an aid while debugging, then you can obtain one by specifying OUTPUT(*PRINT). A listing is important if you intend to debug using a statement (*STMT) view since the statement numbers for setting breakpoints are those identified in the source listing. The statement numbers are listed in the column labeled as the Line Number when OPTION(*NOSRCSTMT) is specified, and in the column labeled as the Statement Number when OPTION(*SRCSTMT) is specified.
  • If you know that you will have considerable debugging to do, you may want to compile the source with DBGVIEW(*ALL), OUTPUT(*PRINT) and OPTION(*SHOWCPY). This will allow you to use either a source or listing view, and it will include /COPY members.
  • If you specify DBGVIEW(*LIST), the information available to you while debugging depends on what you specified for the OPTION parameter. The view will include /COPY members and externally described files only if you specify OPTION(*SHOWCPY *EXPDDS) — these are the defaults.