Compaq COBOL AAQ2G1FTK User Manual

Page 165

Advertising
background image

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

FIELD1 Value

ABCDEFGHI

INSPECT FIELD1...BEFORE "E".

ABCDEFGHI

INSPECT FIELD1...AFTER "E".

ABCDEFGHI

INSPECT FIELD1...BEFORE "K".

ABCDEFGHI

INSPECT FIELD1...AFTER "K".

ABCDEFGHI

INSPECT FIELD1...BEFORE "AB".

ABCDEFGHI

INSPECT FIELD1...AFTER "AB".

ABCDEFGHI

INSPECT FIELD1...BEFORE "HI".

ABCDEFGHI

INSPECT FIELD1...AFTER "HI".

ABCDEFGHI

INSPECT FIELD1...BEFORE "I".

ABCDEFGHI

INSPECT FIELD1...AFTER "I".

ZK−1426A−GE

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.

Using the STRING, UNSTRING, and INSPECT Statements 5–19

Advertising