Inspect Manual

Using Inspect With COBOL and SCREEN COBOL
Inspect Manual429164-006
10-4
COBOL 74 and SCREEN COBOL Examples
Specifying code locations by line number
If no COBOL statement begins at the line number you specify, Inspect issues this
warning:
Inspect then uses the statement starting at the given line number. If more than one
COBOL statement begins on the line you specify, Inspect uses the start of the first
statement.
COBOL 74 and SCREEN COBOL Examples
This example assume the COBOL program fragment:
IDENTIFICATION DIVISION.
PROGRAM-ID. prg.
...
PROCEDURE DIVISION.
SECTION. s1.
PARAGRAPH. p1.
...
PARAGRAPH. p2.
...
SECTION. s2.
PARAGRAPH. p1.
...END PROGRAM prg.
Here are some code locations:
These code locations assume a current scope path of #PRG:
** Inspect warning 117 ** A subsequent line number is assumed: line-number
Code Location Specifies
PRG.PRG The primary entry point of program unit PRG.
#PRG.P2 Paragraph P2 of section S1 of program unit PRG.
#PRG.P1 OF S2 Paragraph P1 of section S2 of program unit PRG. The clause OF S2
is required to distinguish between the paragraph P1 in section S1 and
the one in section S2.
Code Location Specifies
S2 Section S2 of program unit PRG.
S1 + 3S Three COBOL sentences past the start of section S1 of program unit
PRG (the fourth sentence of S1).
S1 + 3S + 2V Two COBOL statements past three COBOL sentences past the start of
section S1 of program unit PRG (the third statement of the fourth
sentence of S1).