COBOL Manual for TNS and TNS/R Programs

Compiler Diagnostic Messages
HP COBOL Manual for TNS and TNS/R Programs522555-006
47-2
Message Indicator Line
Message Indicator Line
A message indicator line precedes each compiler diagnostic message. If possible, the
message indicator line specifies the location of the problem or the unacceptable object
with one or more of these:
A caret (^) showing where in the source line the compiler recognized the problem
For the COBOL85 compiler, the phrase “Problem on line nnnnn ” where nnnnn is
the line number of the source line where the compiler recognized the problem
The user-defined name of the object that the problem involves
The message indicator line cannot always tell you exactly where the problem is
because the problem might not be recognizable (and reportable) until the compiler is
past the source line that contains it.
Table 47-2. Problem Discovery Time, Message Indicator Line Contents, and
Problem Location
Problem Discovery Time
Message Indicator Line
Contents Problem Location
During textual or syntactic
analysis of a particular
source file line
Caret (^) (usually),
“Problem on line nnnnn
(maybe)
Language element marked by
caret, source file line number
nnnnn
During semantic analysis of
an operand phrase, clause,
or statement
“Problem on line nnnnn
(usually), caret (^)
(maybe)
In vicinity of source file line
number nnnnn, language
element marked by caret
After analyzing many source
lines, possibly an entire
source program
User-defined name of
object, “Problem on line
nnnnn ” (maybe)
With the named object, in
vicinity of source file line
number nnnnn
Example 47-1. Message Indicator Line (COBOL85 Compiler)
13 MOVE "" TO A.
^ Problem on line 13
** Error 30 ** Null literal
Example 47-2. Message Indicator Line (NMCOBOL Compiler)
13 MOVE "" TO A.
*** Error: ^
--> Null literal [Error 30]