COBOL Manual for TNS/E Programs (H06.03+)
Procedure Division Verbs
HP COBOL Manual for TNS/E Programs—520347-003
9-87
INSPECT TALLYING
INSPECT TALLYING
INSPECT TALLYING counts occurrences of a sequence of one or more characters in a
source string.
source-string
is the identifier of an elementary item or data structure with USAGE DISPLAY.
Inspection proceeds from left to right within source-string.
tallying-phrase
tally
is the identifier of an elementary numeric item where the number of
occurrences is to be stored. The INSPECT statement does not initialize tally
but adds to its current value. If you want tally to begin at a given number,
set it before the INSPECT statement executes.
for-clause
CHARACTERS
specifies that any character in source-string that has not satisfied a
previous compare-string relation is counted, regardless of its value.
INSPECT source-string tallying-phrase
VST164.vsd
FORtallyTALLYING for-clause
VST165.vsd
CHARACTERS
ALL
LEADING
compare-string
position
position
VST166.vsd










