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

Delete all the members in a PDS except few


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

New User


Joined: 17 Apr 2008
Posts: 44
Location: bangalore

PostPosted: Tue Dec 28, 2010 6:35 pm
Reply with quote

Hi all,

I want to delete all the members in a PDS except the partical member(4 members) using a job(JCL).

Can any one give some idea please?

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: Tue Dec 28, 2010 7:07 pm
Reply with quote

With the amount of information that you have given, NO

Try to think about what we need to know to help you before posting and save everyones time.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Dec 28, 2010 7:07 pm
Reply with quote

Sure. Create the list of all members (TSO LISTDS), exclude those you want to keep and then build a series of DELETE statemements from the result (SORT). Then run the deletes (TSO DELETE).
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Dec 28, 2010 7:10 pm
Reply with quote

Or do it in one single REXX step
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Wed Dec 29, 2010 8:01 pm
Reply with quote

An alternative is to allocate a new PDS with the same DCB properties, copy the 4 members to be retained into that dataset, and discard or rename the old dataset.

If you delete a lot of members repetitively, you will soon run out of either directory space and/or data space, as deleted members will not physically be deleted, unless you compress the dataset afterwards.
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Thu Dec 30, 2010 12:17 am
Reply with quote

Kjeld wrote:
If you delete a lot of members repetitively, you will soon run out of either directory space and/or data space....
Directory space is always reclaimed because the directory blocks are rewritten. You are correct about data space, unless a PDSE is used.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Dec 30, 2010 2:47 am
Reply with quote

Hello,

If only a few were to be "saved", i'd use the new pds approach rather than deleting the majority.

Seems to me that this would be far less effort as well as there would be no space consideration (assuming the new pds is allocated at the same size as the original) icon_smile.gif
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Thu Dec 30, 2010 2:17 pm
Reply with quote

Bill Dennis wrote:
Kjeld wrote:
If you delete a lot of members repetitively, you will soon run out of either directory space and/or data space....
Directory space is always reclaimed because the directory blocks are rewritten. You are correct about data space, unless a PDSE is used.

Directory blocks will be rewritten allright, but if you dont't compress, deleted member information will still be in the directory, just marked 'deleted'.
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 DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts How to delete a user's alias from the... JCL & VSAM 11
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts list pds members name starting with xyz CLIST & REXX 11
Search our Forums:

Back to Top