REPLACE—Replace Data
The REPLACE primary command replaces a sequential data set, member of a partitioned data set, or z/OS® UNIX file with data you are editing. If a member or z/OS UNIX file you want to replace does not exist, the editor creates it. If a member you want to replace exists and the member is in a PDSE version 2 data set that is configured for member generations, the editor creates a new generation of the member. This new generation becomes the current generation (also known as generation zero). The editor cannot create a new sequential data set.
If no options are specified with the REPLACE command, the Edit/View Replace panel is displayed.
Syntax
- 1 If you don't specify the group of lines using labels, you must specify the group by using C or M line commands.
- member
- The name of the member to be replaced in the partitioned data
set currently being edited. If a name of eight characters or fewer
is specified and it could be a member name or a data set name, REPLACE
searches for a member name first. If no member is found, then the
name is used as a data set name. If the member does not exist, the
editor creates it. If you are using a concatenated sequence of libraries,
the editor writes the member to the first library in the sequence.
This operand is optional.
To replace a sequential data set or a member of a different partitioned data set, enter REPLACE without a member operand. The editor displays the Edit Replace panel, from which you can enter the data set name.
- dsname
- A partially qualified or fully qualified sequential data set you want to replace.
- pathname
- The pathname for a z/OS UNIX regular file to be replaced. If the file does not exist, it is created. (Also, see Specifying z/OS UNIX pathnames with edit primary and macro commands.)
- dsname(member)
- A partially qualified or fully qualified partitioned data set and member you want to replace.
- labela, labelb
- Labels identifying the start and end of the group of lines to
replace the member or data set.
For more information about using labels to identify a group of lines, see Labels and line ranges.
- ASCII, EBCDIC, UTF8
- When one of these keywords is supplied, if the data is using a different character set to that designated by the keyword, the data being replaced in the external file is converted to the character set designated by the keyword.
Description
To replace a member of a partitioned data set, a sequential data set, or a z/OS UNIX file:
- On the command line, type one of these commands:
REPLACE member labela labelb REPLACE (member) labela labelb REPLACE dsname labela labelb REPLACE dsname(member) labela labelb REPLACE pathname labela labelb
The member operand is optional unless you specify the name of a partitioned data set. It represents the name of the member that you want to replace. If you specify a data set name only, it must be a sequential data set.
The labela and labelb operands are optional, also. They represent a pair of labels that show the first and last lines in a group of lines used to replace the member.
If you omit the labela and labelb operands, you must specify the lines by using either the C (copy) or M (move) line command. See the descriptions of these commands if you need more information about them.
If you omit the labela and labelb operands, and do not enter one of the preceding line commands, a
REPLACE Pending
message is displayed in the upper-right corner of the panel. - Press Enter. If you did not specify the name of a member, data
set, or z/OS UNIX file, the Edit/View Replace panel is displayed.
Enter the name of the member, data set, or z/OS UNIX file
to be replaced on this panel and press Enter again. If you used either
a pair of labels or a C line command, the data is copied from the
member, data set, or z/OS UNIX file that you are editing into
the member, data set, or z/OS UNIX file that you are replacing.
If you used the M line command, however, the data is removed from
the member, data set, or z/OS UNIX file that you are editing and
placed in the member, data set, or z/OS UNIX file that you are replacing.
If the data set specified does not exist, ISPF prompts you to see if the data set should be created. You can create the data set using the characteristics of the cataloged source data set as a model, or specify the characteristics for the new data set. You can suppress this function through the ISPF configuration table, causing any CREATE request for a nonexistent data set to fail.
See Creating and replacing data for more information about the REPLACE command.
Examples
These steps show how you can replace a member when you omit the member name. These same steps apply when you create data.
- Type
REPLACE
and specify which lines you want to copy or move into the data set or member. The example in Figure 1 uses the MM (block move) line command to move a block of lines from the data. - When you press Enter, the Edit/View Replace panel (Figure 2) appears. Type the name of the member to be replaced and press Enter. A member is created when you type the name of a member that does not already exist. The name of the member replaced in this example is DELDATA.
- Figure 3 shows the lines remaining in the data being edited after the specified lines were moved.
- Figure 4 shows the contents of the replaced member.