Empty PDS using JCL.

JES2/3, JCL, utilities.
Post Reply
Nilkhant R
New Member
Posts: 2
Joined: Wed Dec 10, 2014 5:42 pm

Empty PDS using JCL.

Post by Nilkhant R »

Hi,

In a process execution the process creates many temporary members in 7 PDSes. However, once we are done with the execution, I need to cleanup the temorary memebers. I need to know if we have some JCL that can empty the specified PDS?
User avatar
Akatsukami
Global Moderator
Global Moderator
Posts: 122
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL
Contact:

Re: Empty PDS using JCL.

Post by Akatsukami »

Unless deleting and redefining the data set is acceptable, JCL cannot do what you want. I would use ISPF services, but some of the other sempai may have better suggestions.
"I come to the conclusion that, men loving according to their own will and fearing according to that of the prince, a wise prince should establish himself on that which is in his own control and not in that of others." -- Niccolò Machiavelli
vikriih
New Member
Posts: 8
Joined: Sat Oct 24, 2015 3:31 pm

Re: Empty PDS using JCL.

Post by vikriih »

If the name of the temporary PDS members is known we can delete them by using IEFBR14 utility of the JCL. Delete them like any other sequential dataset by giving MVS.USERID.JCL(TEMPMEM) where tempmem is the name of temporary member
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: Empty PDS using JCL.

Post by enrico-sorichetti »

did You test ?
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Empty PDS using JCL.

Post by nicc »

The usual way to do this is to allocate the PDS in step one, use it through the job and then delete it as the last step of the job.
Regards
Nic
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Empty PDS using JCL.

Post by Robert Sample »

vikriih, are you aware that IEFBR14 is used for DATA SET deletion? If you provide a PDS with member name, the entire PDS will be deleted -- not just the referenced member.
Nilkhant R
New Member
Posts: 2
Joined: Wed Dec 10, 2014 5:42 pm

Re: Empty PDS using JCL.

Post by Nilkhant R »

Read through all the responses, is there just no way to do it?

We are deleting the entire PDS as of now.
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Empty PDS using JCL.

Post by nicc »

Yes there is:

Get a list of the members
Take that list and create control cards for the utility to be used
Execute that utility

3 steps but you could roll them into one by using a Rexx program. However, the currentg method is the most efficient.
Regards
Nic
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Empty PDS using JCL.

Post by William Collins »

If they are only temporary, why are they in a permanent library? Do they need to be members at all, can they not just be sequential datasets? Even if they must be members, have you considered using a temporary PDS?
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “JCL - Job Control Language.”