COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-114
INSPECT CONVERTING
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.
INITIAL
is for documentation only and has no effect.
delim-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.
Example 9-41 shifts any lowercase letters found in IN-BUFFER to uppercase letters.
Example 9-41. INSPECT CONVERTING Statement
INSPECT IN-BUFFER
CONVERTING "abcdefghijklmnopqrstuvwxyz"
TO "ABCDEFGHIJKLMNOPQRSTUVWXYZ".
BEFORE
AFTER INITIAL
delim-string
VST167.vsd