COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

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.
position
marks a beginning or ending point for an INSPECT scan cycle. A CHARACTERS phrase,
ALL phrase, or LEADING phrase can have a single BEFORE phrase, a single AFTER
phrase, or one BEFORE phrase and one AFTER phrase in either order.
BEFORE
specifies that scanning is up to but not including the character or characters matching
delim-string. If INSPECT does not find delim-string in source-string,
it scans all of source-string.
INSPECT 353