Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Replace of a PDS Member by another PDS member by same name
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: 523
Location: The Universe

PostPosted: Fri Aug 28, 2015 9:34 am    Post subject:
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    Post subject:
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 User


Joined: 31 Dec 2009
Posts: 440
Location: London

PostPosted: Tue Sep 08, 2015 2:11 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Browsing member from any PDS shiitiizz CLIST & REXX 7 Wed Mar 08, 2017 1:17 am
No new posts Bind plan as a member to another bind... rexx77 DB2 0 Thu Feb 16, 2017 2:02 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us