Page 1 of 1

Empty PDS using JCL.

Posted: Mon Oct 26, 2015 2:44 pm
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?

Re: Empty PDS using JCL.

Posted: Mon Oct 26, 2015 2:56 pm
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.

Re: Empty PDS using JCL.

Posted: Mon Oct 26, 2015 3:56 pm
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

Re: Empty PDS using JCL.

Posted: Mon Oct 26, 2015 4:25 pm
by enrico-sorichetti
did You test ?

Re: Empty PDS using JCL.

Posted: Mon Oct 26, 2015 4:40 pm
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.

Re: Empty PDS using JCL.

Posted: Mon Oct 26, 2015 5:56 pm
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.

Re: Empty PDS using JCL.

Posted: Mon Nov 02, 2015 3:43 pm
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.

Re: Empty PDS using JCL.

Posted: Mon Nov 02, 2015 4:01 pm
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.

Re: Empty PDS using JCL.

Posted: Mon Nov 02, 2015 5:36 pm
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?