COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
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. Each 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.
AFTER
specifies that scanning starts at the position immediately following the character or
characters matching delim-string. If INSPECT does not find delim-string
in source-string, it does not scan source-string.
346 Procedure Division Verbs










