Native Inspect Manual (H06.13+, J06.03+)

3 Using Native Inspect With COBOL Programs
This section describes concepts and additional details for using Native Inspect with COBOL
programs.
Understanding how Native Inspect finds Data Items
Native Inspect follows COBOL scoping rules for finding data items specified in Native Inspect
commands. That is, Native Inspect attempts to find the item in the current program unit (the program
unit where execution is currently suspended). If Native Inspect cannot find the item in the current
program unit, it looks in containing program units if the data item is declared GLOBAL.
In nested program units, a data item declared in an inner program unit can “hide” a global data
item with the same name that is also declared in an outer program unit. When execution is
suspended in the inner program unit, the only way to access the item in the outer program unit is
to change the currently selected stack frame to the stack frame containing the outer item.
Handling of SOURCE and COPY Directives
Displaying Lines Included by SOURCE and COPY Directives
Native Inspect does not merge the source lines from SOURCE and COPY directives into the source
listed for a program unit. Therefore, when you enter a list filename:line-number command,
only the lines in the specified file are shown, and not the lines included by any SOURCE or COPY
directives in the file. To list any source lines that were copied by a nested SOURCE or COPY directive,
you must enter a separate list command for the file named in the directive.
Setting Breakpoints at Lines Included by SOURCE and COPY Directives
In a COBOL program that contains SOURCE and COPY directives, identical line numbers can
occur within a program unit. If, in a break command, you specify a line number with no
qualification, Native Inspect sets a breakpoint at each instance of that line number. To set a
breakpoint at a particular instance of a line number, you must qualify the line number with the
name of the containing file, using the filename:line-number notation.
Displaying Source Lines
In a program consisting of multiple files, Native Inspect handles the list command as follows:
If the list command specifies a file name, Native Inspect lists the contents of that file.
If the list command does not specify a file name, Native Inspect lists the contents of the last
source file listed since execution was last suspended.
If no source file was listed since execution was last suspended, Native Inspect displays the
contents of the file where execution is currently suspended.
NOTE: Note the following conditions:
Native Inspect does not expand SOURCE and COPY directives to list their source inline. To
display source lines included by SOURCE and COPY directives, use a separate list command,
as described under Displaying Lines Included by SOURCE and COPY Directives (page 47).
The list command does not display the results of string substitution done by a REPLACE
statement or a REPLACING clause.
Understanding how Native Inspect finds Data Items 47