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 User


Joined: 30 Nov 2013
Posts: 462
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: 437
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 What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Sort card to replace text using cross... Susanta SYNCSORT 32 Tue Sep 13, 2016 4:17 pm
No new posts Replace function abdulrafi COBOL Programming 13 Mon Sep 12, 2016 10:12 am
No new posts Need a help how to replace a string i... gurunath82 CLIST & REXX 12 Tue Jul 26, 2016 11:43 pm


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