Changing information
What if you wrote a report about a product called Whiz and after the report was completed, you were informed that the product name had been changed to Speedo. You can use the FIND command and find each instance of the old name and change it, or you can use the CHANGE command that automatically changes the old name to the new.
The CHANGE command requires two strings. The first is the word(s)
you want to change, and the second is the changed word(s). CHANGE
can be abbreviated to CHG or C. Thus to change Whiz to Speedo, enter
on the COMMAND line:
c Whiz Speedo
The cursor
moves to the first instance of Whiz and changes it to Speedo.If you want to change all occurrences of a string to another string,
you can add the word all to the command. To change
Whiz every time it occurs in your report to the new name Speedo, enter:
c Whiz Speedo all
==CHG> appears
on every line number where a change was made.To change a phrase to another phrase, enclose the words in single
quotation marks. For example, to change the phrase "generally speaking" to "in
general", enter:
c 'generally speaking' 'in general'
CHANGE
is often used with the RCHANGE PF key (PF 6). For more information
about the RCHANGE PF key, see PF keys summary.| Exercise |
|---|
Display the contents of a data set in an edit session. Be sure the data set does not contain important information. First
enter on the COMMAND line:
The cursor
moves to the first occurrence of a and changes it to ea and
you see the message:
Now enter:
You see ==CHG> on
every line number where a change was made.If you don't want to make the changes permanent, enter cancel on the COMMAND line when you finish this exercise. To save changes, enter save on the COMMAND line or press the END PF key (PF 3). |