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

Copying and deleting extra members


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

New User


Joined: 30 Oct 2009
Posts: 37
Location: India

PostPosted: Fri Feb 26, 2010 6:29 pm
Reply with quote

Hi

I want to copy(replace) all members of one PDS into other one. However the target library has members than the source one. I want all matched members to be replaced, unmatched in source to be copied to target and unmatched in target to be deleted so that afterwards both are same.

By using IEBCOPY with Replace the unmatched members in target still remaims.

Thank you
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Feb 26, 2010 6:31 pm
Reply with quote

Have you considered deleting and recreating the target PDS.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Feb 26, 2010 6:40 pm
Reply with quote

Quote:
I want all matched members to be replaced,
unmatched in source to be copied to target
unmatched in target to be deleted so that afterwards both are same.


why not simply delete the destination dataset and do a full iebcopy
if You have authorizations issues ask Your support if a tool is available to <empty> a PDS/PDSE

or search the forums for suggestions empty pds might be a good search argument
ibmmainframes.com/viewtopic.php?t=25611&highlight=empty+pds
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Feb 26, 2010 6:44 pm
Reply with quote

Quote:
Have you considered deleting and recreating the target PDS.


I feel that the issue is not completely unreasonable, too many times the access is just UPDATE

that' s what I usually do for my important datasets, after allocating them I lower my own racf authorization to update
due to fast/fat fingers a few times I deleted important stuff ,
and granting myself a lower authority solved the problem
Back to top
View user's profile Send private message
Madhaviy

New User


Joined: 30 Oct 2009
Posts: 37
Location: India

PostPosted: Fri Feb 26, 2010 6:59 pm
Reply with quote

Deleting is not recommended as it is a load library.
Will ADRDSSU using RENUNC with REPLACEU be useful?

Thank you,
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Feb 26, 2010 7:12 pm
Reply with quote

ADRDSSU operates at the data set level, not the PDS member level.

If I understand your requirement correctly, you have several choices:
1. Delete and redefine the data target to get rid of everything in it, then do the copy from the source.
2. Accept the unchanged target members as being there
3. Manually compile a list of the target members that need to be deleted and delete them (via ISPF 3.4 for example).
4. Write a program to parse a printout of the two member lists so it can generate the delete statements to get rid of the unwanted target members
5. Delete all members of target then do the copy
Back to top
View user's profile Send private message
Madhaviy

New User


Joined: 30 Oct 2009
Posts: 37
Location: India

PostPosted: Fri Feb 26, 2010 7:38 pm
Reply with quote

Thanks Robert.

ADRDSSU works at dataset level.
Is it possible that it may Replace a complete dataset(which is our target) using REPLACEU with our source dataset.
so that there are no deletes involved, though technically it is deleting some members.

thank you,
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 580
Location: London

PostPosted: Mon Mar 01, 2010 4:00 pm
Reply with quote

To allow for a 'backout' it's probably best to rename the target to something else (e.g. .OLD suffix).

You can then use DFDSS (ADRDSSU) to COPY RENAMEU your source to create the original target dsname to end up with just the members from the source library. The only consideration is that the target will inherit all the characteristics of the source library in terms of DCB (lrecl & blksize) and space sizing including directory blocks. If that is not what's desired then you'd have to just allocate a new (empty) target library with the desired DCB etc, and IEBCOPY the source into it.
Back to top
View user's profile Send private message
Madhaviy

New User


Joined: 30 Oct 2009
Posts: 37
Location: India

PostPosted: Thu Mar 04, 2010 12:12 pm
Reply with quote

Thanks Pete.
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 Deleting a Tape file JCL & VSAM 14
No new posts CA7 deleting files in steps after job... CA Products 4
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts Panvalet - 9 Character name - Issue c... CA Products 6
No new posts list pds members name starting with xyz CLIST & REXX 11
Search our Forums:

Back to Top