delete a member from pds based on creation date.

JES2/3, JCL, utilities.
Post Reply
Geetu
Registered Member
Posts: 24
Joined: Tue Oct 21, 2014 5:31 pm

delete a member from pds based on creation date.

Post 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.
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: delete a member from pds based on creation date.

Post 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.
Geetu
Registered Member
Posts: 24
Joined: Tue Oct 21, 2014 5:31 pm

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

Post 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.
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.”