Hello, I read with interest an older post titled, "Simple delete old spool files". I have a similar situation. We have an older system that has become a hodge-podge of CL, COBOL, SYNON, RPGLE, and SQL.
When the users sign off, they're prompted to delete their spool files. However, we have some system generated spool files that hang around. Plus, they delete the information that we developers could use to troubleshoot when they find a problem 3 days later! . I'm starting small, with a particular file (an FTP log). I want to keep it about 2 days and then delete it.
Being the simple person I am, I thought I could run DLTEXPSPLF in a CL followed by this command;
CHGSPLFA FILE(*SELECT) SELECT(*ALL *ALL *ALL +
ZMFTPPLOG) EXPDATE(*DAYS) DAYS(&DAYS)
But I realize that's not going to work. The first day, the program will not delete anything and will set the expiration date to 2 days out. The second day, the program won't delete anything and will REset the expiration date to another 2 days out. Right?
So, I know I can use an API to get the current user's spool files (I just have to figure out how to get all users' spool files instead) but I'm not sure that's the right answer...
I guess I'm just looking for a starting point - some ideas to help me find the best way to clean out our old spool files based on the file name (or USER DATA) - so I can have different expiration parameters depending on what the spool file is, but I'm not hard coding file names or user data...
I'm sorry this is a little disjointed. I appreciate any ideas!
When the users sign off, they're prompted to delete their spool files. However, we have some system generated spool files that hang around. Plus, they delete the information that we developers could use to troubleshoot when they find a problem 3 days later! . I'm starting small, with a particular file (an FTP log). I want to keep it about 2 days and then delete it.
Being the simple person I am, I thought I could run DLTEXPSPLF in a CL followed by this command;
CHGSPLFA FILE(*SELECT) SELECT(*ALL *ALL *ALL +
ZMFTPPLOG) EXPDATE(*DAYS) DAYS(&DAYS)
But I realize that's not going to work. The first day, the program will not delete anything and will set the expiration date to 2 days out. The second day, the program won't delete anything and will REset the expiration date to another 2 days out. Right?
So, I know I can use an API to get the current user's spool files (I just have to figure out how to get all users' spool files instead) but I'm not sure that's the right answer...
I guess I'm just looking for a starting point - some ideas to help me find the best way to clean out our old spool files based on the file name (or USER DATA) - so I can have different expiration parameters depending on what the spool file is, but I'm not hard coding file names or user data...
I'm sorry this is a little disjointed. I appreciate any ideas!
Comment