View previous topic :: View next topic
|
Author |
Message |
manas121
New User
Joined: 05 Jan 2012 Posts: 15 Location: India
|
|
|
|
Hi All,
I have two PDS - '1' & '2'. Each PDS conatin a memeber having the name 'A'.
I want to copy/replace the member A from PDS 1 by the member A of PDS 2. The following ways are possible :
1. First delete member A in PDS '1' then Copy member A from PDS '2' to '1' by IEBCOPY.
2. First rename member A in PDS '1' then Copy member A from PDS '2' to '1' by IEBCOPY.
As per requirement, I can not delete and rename in production library from above approaches. Is it possible to replace member A in PDS '1' by member 'A' in PDS '2' by using JCL utility in single step. Please help.
Thanks a lot. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
This is all very standard stuff to do the job in batch. It can also be done in TSO/ISPF.
Code: |
//A EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//INPUT DD DISP=SHR,DSN=PDS1
//OUTPUT DD DISP=SHR,DSN=PDS2
//SYSIN DD *
COPY INDD=(INPUT,R),OUTDD=OUTPUT
SELECT MEMBER=A |
|
|
Back to top |
|
|
manas121
New User
Joined: 05 Jan 2012 Posts: 15 Location: India
|
|
|
|
steve-myers wrote: |
This is all very standard stuff to do the job in batch. It can also be done in TSO/ISPF.
Code: |
//A EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//INPUT DD DISP=SHR,DSN=PDS1
//OUTPUT DD DISP=SHR,DSN=PDS2
//SYSIN DD *
COPY INDD=(INPUT,R),OUTDD=OUTPUT
SELECT MEMBER=A |
|
Thanks a lot Steve. I will try it. |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 580 Location: London
|
|
|
|
REPLACE can also be done selectively at individual member level
e.g. replaces MEMBER1/2/3 but not MEMBER4
COPY INDD=(INPUT),OUTDD=OUTPUT
S M=((MEMBER1,,R))
S M=((MEMBER2,,R))
S M=((MEMBER3,,R))
S M=MEMBER4
As can rename of individual members
COPY INDD=(INPUT,R),OUTDD=OUTPUT
S M=((OLDNAME,NEWNAME)) |
|
Back to top |
|
|
|