COBOL Manual for TNS/E Programs (H06.03+)

Procedure Division Verbs
HP COBOL Manual for TNS/E Programs520347-003
9-86
INSPECT
°
If you omit replacement, the sending operand is the implied figurative
constant SPACES or ZEROS, as this table shows:
The value of sender is established before the implicit MOVE statement
executes.
Execution of the Implicit MOVE Statements
For each receiving operand, the initialization operation executes an implicit MOVE
statement of the form:
MOVE SENDING-OPERAND TO RECEIVING-OPERAND
The implicit MOVE statements are executed in the order that the receiver s
associated with their receiving operands appear in the INITIALIZE statement
(reading from left to right). When a receiver references a data structure, the
affected elementary items are initialized in the order that they are defined within the
data structure. Tables within data structures are initialized element by element.
Operand Overlap
The storage area referenced by a sender cannot be the same as or overlap the
storage area referenced by a receiver. If this rule is violated, the operation is
undefined.
INSPECT
INSPECT scans a data item and counts and/or replaces occurrences of a single
character or groups of characters.
Category of Receiving Operand Sending Operand
ALPHABETIC SPACES
ALPHANUMERIC SPACES
ALPHANUMERIC-EDITED SPACES
NUMERIC ZEROS
NUMERIC-EDITED ZEROS
Form Description
INSPECT TALLYING
Counts occurrences of a character sequence in a
source string
INSPECT REPLACING
Replaces occurrences of a character sequence in a
data item with a specified value
INSPECT TALLYING REPLACING
Counts occurrences of a character sequence in a data
item and replaces each occurrence with a specified
value
INSPECT CONVERTING
Performs a character-for-character replacement