Using the STRING, UNSTRING, and INSPECT Statements
5.3 Examining and Replacing Characters Using the INSPECT Statement
Figure 5–2 Matching Delimiter Characters to Characters in a Field
Instruction
INSPECT FIELD1...BEFORE "E".
INSPECT FIELD1...AFTER "E".
INSPECT FIELD1...BEFORE "K".
INSPECT FIELD1...AFTER "K".
INSPECT FIELD1...BEFORE "AB".
INSPECT FIELD1...AFTER "AB".
INSPECT FIELD1...BEFORE "HI".
INSPECT FIELD1...AFTER "HI".
INSPECT FIELD1...BEFORE "I".
INSPECT FIELD1...AFTER "I".
The compiler alters the digit position containing the sign before beginning the
INSPECT operation and restores it to its former value after the operation. If
the sign's digit position does not contain a valid ASCII signed numeric digit,
redefinition causes the value to change.
Table 5–10 shows these original, altered, and restored values.
The compiler never moves an implicitly redefined item from its storage position.
All redefinition occurs in place.
The position of an implied decimal point on numeric quantities does not affect
implicit redefinition.
FIELD1 Value
ABCDEFGHI
ABCDEFGHI
ABCDEFGHI
ABCDEFGHI
ABCDEFGHI
ABCDEFGHI
ABCDEFGHI
ABCDEFGHI
ABCDEFGHI
ABCDEFGHI
Using the STRING, UNSTRING, and INSPECT Statements 5–19
ZK−1426A−GE
Need help?
Do you have a question about the COBOL AAQ2G1FTK and is the answer not in the manual?