You cannot specify more than one BEFORE phrase and one AFTER phrase for any one ALL, LEADING, CHARACTERS, FIRST, or CONVERTING phrase.
If you specify more than one BEFORE or AFTER phrases, the rules for counting and replacing are modified.
When you specify the BEFORE phrase, counting and/or replacing of the inspected item begins at the leftmost character and continues until the first occurrence of the delimiter is reached. If no delimiter is present in the inspected item, counting and/or replacing continues toward the rightmost character.
When you specify the AFTER phrase, counting and/or replacing of the inspected item begins with the first character to the immediate right of the delimiter and continues toward the rightmost character in the inspected item. If no delimiter is present in the inspected item, no counting or replacement takes place.
Identifier-4 or literal-2 is the delimiter. It is not counted or replaced. Instead, it serves as the boundary for the counting and/or replacing of the inspected item.
If identifier-4 or literal-2 is a figurative constant, it is considered to be 1 character in length.
If you specify ALL, the count field is increased by 1 for each nonoverlapping occurrence in the inspected item, of this tallying operand, beginning at the leftmost character position and continuing to the rightmost.
If you specify LEADING, the count field is increased by 1 for each contiguous nonoverlapping occurrence in the inspected item of this tallying operand, provided that the leftmost such occurrence is at the point where comparison began in the first comparison cycle for which this tallying operand is eligible to participate.
Identifier-3 is the tallying operand.
Identifier-3 must be an elementary data item with USAGE DISPLAY.
When the tallying operand is a figurative constant, it is considered to be a 1-character nonnumeric literal.
Literal-1 is the tallying field.
Literal-1 must be nonnumeric and may be any figurative constant that does not begin with the word ALL. If literal-1 is a figurative constant, it refers to an implicit 1 character data item.
With the REPLACING phrase, the subject field and the substitution field must be the same length.
If you specify CHARACTERS, the substitution field must be 1 character in length. Each character in the inspected field is replaced by the substitution field, beginning at the leftmost character and continuing to the rightmost.
Identifier-5 is the substitution field. The subject field and the substitution field must be the same length.
Identifier-5 must be an elementary data item with USAGE DISPLAY.
Literal-3 is the substitution field. The subject field and the substitution field must be the same length.
Literal-3 must be nonnumeric and may be any figurative constant that does not begin with the word ALL.
If you specify ALL, each nonoverlapping occurrence of the subject field in the inspected item is replaced by the substitution field, beginning at the leftmost character and continuing to the rightmost.
If you specify LEADING, each contiguous nonoverlapping occurrence of the subject field in the inspected item is replaced by the substitution field, provided that the leftmost such occurrence is at the point where comparison began in the first comparison cycle for which this substitution field is eligible to participate.
If you specify FIRST, the leftmost occurrence of the subject field in the inspected item is replaced by the substitution field.
Identifier-3 is in the subject field when you specify the REPLACING phrase.
Identifier-3 must be an elementary data item with USAGE DISPLAY.
The subject field and the substitution field must be the same length.
Literal-1 is in the subject field when you specify the REPLACING phrase.
Literal-1 must be nonnumeric and may be any figurative constant that does not refer to the word ALL. If literal-1 is a figurative constant, it refers to an implicit 1 character data item.
The subject field and the substitution field must be the same length.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.