The REPLACE
macro command adds or replaces data in a member of the partitioned
data set that you are editing, in a member of another partitioned
data set, in a sequential data set, or in a z/OS® UNIX file.
Syntax
Macro command syntax
>>-ISREDIT--REPLACE--+-member---------+--+----------------+----->
+-(member)-------+ '-labela--labelb-'
+-dsname(member)-+
+-dsname---------+
'-pathname-------'
>--+--------+--------------------------------------------------><
+-ASCII--+
+-EBCDIC-+
'-UTF8---'
- member
- The name of the member to be replaced in the partitioned data
set currently being edited. If a name of eight or fewer characters
is specified and it could be a member name or a data set name, REPLACE
searches for a member name first. If no member name is found, then
the name is used as a data set. If the member does not exist, the
editor creates it. If you are using a concatenated sequence of libraries,
the member is always written to the first library in the sequence.
- dsname
- The name of a sequential data set that is to be replaced. The
data set name can be fully or partially qualified.
- dsname(member)
- The name of a different partitioned data set and member name to
be replaced in the partitioned data set. The data set name can be
fully or partially qualified.
- 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.)
- linenum1
- Relative
line number identifying the start of a group of lines in the current
member that replace data in the other member.
- linenum2
- Relative
line number identifying the end of a group of lines in the current
member that replace data in the other member.
- labela, labelb
- Labels identifying the start and end of the group of lines in
the current member that replace data in the other member.
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.
Return codes
- 0
- Normal completion
- 8
- Member in use
- 12
- Invalid line pointer
- 20
- Syntax error (invalid name, incomplete line pointer value), or
I/O error
Examples
To replace member MEM1 with the
first 10 lines of the current data:
ISREDIT REPLACE MEM1 1 10