IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Replace of a PDS Member by another PDS member by same name


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manas121

New User


Joined: 05 Jan 2012
Posts: 15
Location: India

PostPosted: Fri Aug 28, 2015 9:02 am
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Fri Aug 28, 2015 9:34 am
Reply with quote

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
View user's profile Send private message
manas121

New User


Joined: 05 Jan 2012
Posts: 15
Location: India

PostPosted: Fri Aug 28, 2015 9:38 am
Reply with quote

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
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 580
Location: London

PostPosted: Tue Sep 08, 2015 2:11 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
No new posts How to copy the -1 version of a membe... TSO/ISPF 4
No new posts Searching for a member but don't know... TSO/ISPF 6
Search our Forums:

Back to Top