ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

DLTEXPSPLF and changing spool file expiration dates

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DLTEXPSPLF and changing spool file expiration dates

    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!

  • #2
    Do you happen to have the old, free version of TAATOOL?

    If you do, there's the DLTOLDSPLF command that may simplify this for you.

    Actually, it looks like it may still be available:



    Cheers,

    Emmanuel

    Comment


    • #4
      We wrote our own utility a decade ago to help us manage spool files because the system tools weren't that great.
      It uses some API's to retrieve a list of spool files. It's not real fancy...but it gets the job done ;-)

      Code:
                               Clear Spooled Files (CLRSPL)            
      
      Type choices, press Enter.                                       
      
      Output Queue . . . . . . . . . .                 Character value
      Retention Days . . . . . . . . .   000           000-999         
      Limit to User-Id . . . . . . . .                 Character value
      Limit to Job name  . . . . . . .                 Character value
      Audit Report . . . . . . . . . .   *YES          *NO, *YES       
      Remove *SAV Spool Files  . . . .   *NO           *NO, *YES
      If you think it might be helpful...I can bundle it up and send it to you.

      Comment


      • #5
        Thanks, everyone! This was a great help. I found the API DLTOLDSPLF example and I believe it will do what I need. I just need to tweak it a bit. I plan to add some parms to it so that I can call it based on our needs per file rather than simply by how long the file has existed. Once again, the members of CODE400.com have given me not only the help I needed, but the confidence that I'm choosing the right solution for us.

        Comment

        Working...
        X