Use this primary command to locate and replace one or more occurrences
of a character string in the data being edited.
The CHANGE command only affects
the record you have zoomed in on.
After the data has been changed, File Manager places
the cursor at the beginning of the changed string, automatically
scrolling, if necessary, to bring the string into view.
Figure 1. Syntax
Notes:
1 If none of these parameters (X, EX, or NX) are specified,
excluded and non-excluded records are searched.
Parameters
ALL
Causes the search to begin at the top of the data and find and
replace all occurrences of the string. If you do not limit the search
to non-excluded records, then all excluded records containing the string
are shown and replaced.
col1
The first column to be included in the range of columns to be searched.
Must be greater than or equal to 1, and less than or
equal to the maximum record length.
col2
The last column to be included in the range of columns to be searched.
Must be greater than or equal to col1
and less than or equal to the maximum record length.
If not specified, the last column of the record is used.
EX
Excluded records only.
label1
Label identifying the start of a range of records.
The label must start with a period (.)
followed by one to four alphabetic characters (no numeric or special
characters). Labels starting with the letter “Z” indicate an
editor-assigned label.
label2
Label identifying the end of a range of records.
The label must start with a period (.)
followed by one to four alphabetic characters (no numeric or special
characters). Labels starting with the letter “Z” indicate an
editor-assigned label.
NX
Non-excluded records only.
string1
The string you want to search for. The string can be:
A character string not starting or ending with a quotation
mark and not containing any embedded blanks or commas. The case
of the string is ignored. Uppercase and lowercase representations
of the same character match. For example, the following command
changes the strings black, Black,
and BLACK:
CHANGE black white
A character string enclosed in quotation marks. The string
can contain blanks and commas.
The case of the string is ignored.
For example, 'Exact string' matches 'exact string'.
The string can be a null string (''). If
string1 is a null string, string2 is inserted at the
current column position.
C followed by a character string enclosed in quotation marks (C'Frog'),
or a character string enclosed in quotation marks followed by
C ('Frog'C).
The string can contain blanks and commas. The string must
match exactly (including case).
For example, C'Exact string' does not match
C'exact string'.
The string can be a null string (''). If
string1 is a null string, string2 is inserted at the
current column position.
X followed by a hexadecimal string enclosed in quotation
marks (X'C1C2'), or a hexadecimal string enclosed in quotation marks followed
by X ('C1C2'X).
string2
The string you want to replace string1. The string can be:
A character string not starting or ending with a quotation
mark and not containing any embedded blanks or commas. If CAPS ON
or CASE UPPER is in effect, string2 is translated to uppercase.
A character string enclosed in quotation marks. It can
contain blanks and commas. Case is respected and retained unless
CASE UPPER is in effect, in which case string2 is translated to
uppercase. The string can be a null string ('').
X followed by a hexadecimal string enclosed in quotation
marks (X'C1C2'). If CASE UPPER is in effect, all hexadecimal
representations of lowercase characters are translated to their
equivalent uppercase characters.
X
Same as EX.
See CHANGE/CX primary command for more information about
the parameters used with the CHANGE primary command.
Have feedback? Google Analytics is used to store comments and ratings. To provide a comment or rating for a topic, click Accept All Cookies or Allow All in Cookie Preferences in the footer of this page.