COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
INSPECT CONVERTING
INSPECT CONVERTING performs a character-for-character replacement. It is easier to express
such a replacement with the CONVERTING phrase than it is with a series of REPLACING ALL …
BY … phrases.
source-string
is the identifier of an elementary item or data structure with USAGE DISPLAY. Inspection
proceeds from left to right within source-string.
match
compare-string
is the identifier of any type of elementary 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. A character must not appear more than once in
compare-string.
replace-string
is the identifier of any type of elementary item with USAGE DISPLAY or a nonnumeric literal,
that defines what to replace the source-string characters with. It can be a figurative
constant that does not include the keyword ALL, in which case it represents one character.
The size of replace-string and compare-string must be the same.
position
marks a starting and ending place for a replacement cycle. It follows the same item rules
as replace-string. A CONVERTING 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.
INSPECT 357










