COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-105
INSPECT REPLACING
matching-replacement
defines the character-string being scanned for.
ALL
specifies that all occurrences of compare-string are replaced.
LEADING
specifies scanning for consecutive occurrences of compare-string
beginning at the current position within source-string. For example,
REPLACING LEADING “0” replaces only the first three zeros in
“000120020.”
FIRST
specifies that only the first occurrence of compare-string is replaced.
compare-string
is the identifier of an elementary data item with USAGE DISPLAY or a
nonnumeric literal. It can be a figurative constant that does not include the
keyword ALL, in which case it represents one character. The compare-
string is the character-string being sought.
replace-string
is an identifier of an elementary data item with USAGE DISPLAY or a
nonnumeric literal. It can be a figurative constant that does not include the
keyword ALL, in which case it represents one character. When replace-
string and compare-string are used together, they must be the
same size.
position
is as described earlier for absolute-replacement.
ALL
FIRST
LEADING
BY replace-stringcompare-string
position
VST172.vsd