Using a Compiler Listing
Coordinating Listing Options with Debug View Options
Correcting run-time errors often involves debugging a program. The following con-
siderations 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 State-
| ment 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 debug-
ging 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.
Using a Compiler Listing for Maintenance
A compiler listing of an error-free program can be used as documentation when:
Teaching the program to a new programmer.
Updating the program at a later date.
In either case it is advisable to have a full listing, namely, one produced with
OUTPUT(*PRINT) and with OPTION(*XREF *SHOWCPY *EXPDDS *EXT
*SHOWSKP).
Note: Except for *SHOWSKP, this is the default setting for each of these parame-
ters on both create commands.
Of particular value for program maintenance is the Prologue section of the listing.
This section tells you:
Who compiled the module/program
What source was used to produce the module/program
What options were used when compiling the module/program
You may need to know about the command options (for example, the debug view
selected, or the binding directory used) when you make later changes to the
program.
The following specifications for the OPTION parameter provide additional informa-
tion as indicated:
*SHOWCPY and *EXPDDS provide a complete description of the program,
including all specifications from /COPY members, and generated specifications
from externally described files.
Chapter 6. Creating a Program with the CRTBNDRPG Command 69