ILE COBOL Language Reference
For example, assuming three matched pairs of pseudo-text in a REPLACE
statement:
- The comparison starts with the leftmost source program text word following
the REPLACE statement, and with the first pseudo-text-1.
- Pseudo-text-1 is compared to an equivalent number of contiguous source
program text words according to the following rules:
- If no match occurs, the comparison is repeated with each successive
occurrence of pseudo-text-1 (in our example, there are three occurrences),
until a match is found (go to Step 5)
- If no match is found after all, the next source program text word is
treated as the leftmost program text word, and the cycle begins again at Step
1
- When a match is found, the corresponding pseudo-text-2 replaces the
matched text in the source program
- The source program text word immediately following the rightmost text word
that participated in the match becomes the leftmost source program text
word. The cycle starts again (Step 1) with the first occurrence of
pseudo-text-1.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.