Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 657
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: 461
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 USS: Find and replace string within a... vasanthz All Other Mainframe Topics 5 Thu Aug 02, 2018 4:01 am
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Replace last name by first name anatol DFSORT/ICETOOL 10 Thu Mar 15, 2018 3:43 pm
No new posts help to replace columns by rows Vikas Maharnawar DFSORT/ICETOOL 8 Tue Mar 06, 2018 3:27 pm
No new posts How to replace the below query? pkmurali DB2 12 Tue Feb 27, 2018 9:51 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us