Page 1 of 1

Delete 6th file of existing datasets

PostPosted: Tue Nov 14, 2017 10:00 pm
by szvemana79
mainframe files will be created on daily basis in the format of hlq.slq.tld.m171114( the fourth qualifier is in the format MYYMMDD). These are not gdg versions . These are flat PS files. My requirement is to keep only 6 files at any point of time.so i need to delete the 6th old file whenever a new file is created so that i have only 6 files at any point of time.

is it possible to do using JCL ?

Thanks & Regards
Vemsan

Re: Delete 6th file of existing datasets

PostPosted: Tue Nov 14, 2017 10:09 pm
by NicC
Yes - JCL will run the program you use to do it. Unless you are willing to update the job manually with the data set(s)- not files - to be deleted you will possibly need to write a program to generate the delete request.

Re: Delete 6th file of existing datasets

PostPosted: Tue Nov 14, 2017 10:23 pm
by szvemana79
Thank you for the quick reply. I want to do using JCL utility but not through program. Is it possible to do

Re: Delete 6th file of existing datasets

PostPosted: Tue Nov 14, 2017 10:48 pm
by Akatsukami
"JCL utility" is a meaningless term. Nothing can be done through JCL alone save establish environment and execute programs. If you (or your bosses) insist on this foolishness of using a non-Y2K-compliant date as the LLQ, instead of creating a proper GDG, then write a Rexx programette to identify and delete the oldest data set(s).