Page 1 of 1

delete a member from pds based on creation date.

Posted: Tue Sep 14, 2021 8:45 am
by Geetu
Hi,

Is there a way to read the creation date of a member in PDS?

We have an 'override' library. This library is used only at specific times when we want to override some of the production execution. After the execution it is required to remove the overridden member. But usually people don't remove the memebr and we would like to clean after a week by sending a notification before deleting the member. There are number of members added everyday and removed.

I would like to check the creation date of the member and if it's more than a week, we'd like to send an email to the creator and then after 2 warning will delete it.

Re: delete a member from pds based on creation date.

Posted: Tue Sep 14, 2021 7:02 pm
by Robert Sample
Are you sure the data set is a PDS and not a PDSE? If it is a PDSE then it is more difficult to do this as the format is somewhat different.

Assuming the data set is a PDS, you can read the PDS directory using a program (there is a sample program on this forum to read a PDS directory). You also need to be aware that the create date stored in the PDS directory and displayed by ISPF is NOT required to be there -- ISPF statistics have to be turned on for that data set in order to capture them. It is also possible to turn them off so you are not guaranteed by any means to have the member create date available.

One possible way to achieve your goal without relying upon ISPF statistics would be to read the PDS directory and use the member names to update a VSAM KSDS (keyed on member name) and keep the create date for each member. That would allow you to determine which members need to be deleted; a program could then be used to generate IEBCOPY statements for deleting the members.

Re: delete a member from pds based on creation date.

Posted: Sun Oct 10, 2021 9:05 am
by Geetu
Hi Robert,

Thanks. Yes it is PDS only. I looked at the PDS reading program here https://www.zmainframes.com/downloadsystemcat?id=1

I will be working with it but it sounds too complicated to start with. I was trying to accomplish something on the fly and didn't think that it can get this complex.