The Find/Replace window provides numerous options to allow
for flexibility in replacing data.
If a match is found for the search criteria that was provided,
the data that was retrieved can be replaced with new data. There are
however some limitations to replacing data during a search:
Variable-length files:
- If the Replace With string is shorter than
the original string, and the edit type supports record length change,
the replace will complete successfully and the record length will
be reduced.
- If the Replace With string is longer than
the original string, and the edit type supports record length change,
the replace will complete successfully and the record length will
be increased.
Fixed-length files:
- If the Replace With string is shorter than
the original string, the replace will complete successfully and the
field will be padded with extra blanks to match the record length.
- If the Replace With string is longer than
the original string, the replace will fail unless there are enough
spaces in the field to accommodate the new string.
Once a match has been found, several options have been made available
for replacing the existing data. Selecting the “Replace/Find”
button will replace the current match with the characters entered
into the "Replace With" field. Once the replace
is completed, the editor will move on to the next match. If it is
necessary to replace multiple instances of the same match with new
data, selecting the "Replace All" button will
make the correction for all matches in the search.