ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Simple delete old spool files

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

  • Simple delete old spool files

    Anyone got a simple delete old spool files by date?

    All in a rpgle program accepting maybe a date as parm and outq name.

    I see the free one but it is overly complex and requires too many cmd/clle/rpgle in order for it to work.

    No sorry I don't have TAATOOLS available.

    Thnx
    Bill
    "A good friend will bail you out of jail,
    A true friend would be sitting beside you saying,
    'Wow, that was fun.'"

  • #2
    Re: Simple delete old spool files

    i've got one on my website in the downloads section. it does the simple as well as more complex http://tommyholden.com/downloads
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: Simple delete old spool files

      Thnx Tommy I'll check it out.
      Bill
      "A good friend will bail you out of jail,
      A true friend would be sitting beside you saying,
      'Wow, that was fun.'"

      Comment


      • #4
        Re: Simple delete old spool files

        I also have a program to clean up old spool files. It takes an OUTQ name and number of days to keep as parameters. It consists of a command and an RPG program. It also uses another utility that I have written that qualifies an object name. It also consists of an RPG program and a command. They both make extensive use of API's to keep them self contained.

        I don't have them on a web site, but I could send them as text files.

        Comment


        • #5
          Re: Simple delete old spool files

          Please do post them here if you'd like...
          All my answers were extracted from the "Big Dummy's Guide to the As400"
          and I take no responsibility for any of them.

          www.code400.com

          Comment


          • #6
            Re: Simple delete old spool files

            With V5R4 the DLTEXPSPLF command delete expired spool files
            Patrick

            Comment


            • #7
              Re: Simple delete old spool files

              Originally posted by K2r400 View Post
              With V5R4 the DLTEXPSPLF command delete expired spool files
              BUT you have to set the spooled file attributes for each spooled file to expire (which can be done at creation time or via CHGSPLFA) so unless you have the flexibility to modify all of your programs that generate spooled files DLTEXPSPLF is pretty much useless. of course you could write a program to change them to expired...but since you already have the spooled file number, job info etc why not just delete it at that point?
              I'm not anti-social, I just don't like people -Tommy Holden

              Comment


              • #8
                Re: Simple delete old spool files

                Originally posted by jwreed2345 View Post
                I also have a program to clean up old spool files. It takes an OUTQ name and number of days to keep as parameters. It consists of a command and an RPG program. It also uses another utility that I have written that qualifies an object name. It also consists of an RPG program and a command. They both make extensive use of API's to keep them self contained.

                I don't have them on a web site, but I could send them as text files.
                WHAT??? MINE'S NOT GOOD ENOUGH FOR YOU??? Just kidding
                I'm not anti-social, I just don't like people -Tommy Holden

                Comment


                • #9
                  Re: Simple delete old spool files

                  The last I saw was that he would look at it, so I thought I would offer. The only thing wrong with yours is that it isn't mine. And you know how we all like our own code.

                  Comment


                  • #10
                    Re: Simple delete old spool files

                    Originally posted by tomholden View Post
                    BUT you have to set the spooled file attributes for each spooled file to expire (which can be done at creation time or via CHGSPLFA) so unless you have the flexibility to modify all of your programs that generate spooled files DLTEXPSPLF is pretty much useless. of course you could write a program to change them to expired...but since you already have the spooled file number, job info etc why not just delete it at that point?
                    You are right for the existing spools files to delete, but for future, why not to change the PRTF and put a number of days for the expiration ?
                    Patrick

                    Comment


                    • #11
                      Re: Simple delete old spool files

                      Originally posted by tomholden View Post
                      i've got one on my website in the downloads section. it does the simple as well as more complex http://tommyholden.com/downloads
                      That's one angry colour scheme Tommy - Coffee before coding bro !
                      Greg Craill: "Life's hard - Get a helmet !!"

                      Comment


                      • #12
                        Re: Simple delete old spool files

                        Originally posted by gcraill View Post
                        That's one angry colour scheme Tommy - Coffee before coding bro !
                        angry is my best and favorite emotion
                        I'm not anti-social, I just don't like people -Tommy Holden

                        Comment


                        • #13
                          Re: Simple delete old spool files

                          Originally posted by K2r400 View Post
                          You are right for the existing spools files to delete, but for future, why not to change the PRTF and put a number of days for the expiration ?
                          which was kind of my point, however if there is no PRTF being used you would have to change your programs to use OVRPRTF to set the expiration date. internal printer files are still way more common than external ones...
                          I'm not anti-social, I just don't like people -Tommy Holden

                          Comment


                          • #14
                            Re: Simple delete old spool files

                            Originally posted by tomholden View Post
                            i've got one on my website in the downloads section. it does the simple as well as more complex http://tommyholden.com/downloads
                            Heya Tommy, I am trying to mod this locally, I have chanegd the *PNLGRP but it does not work as intended. What is the command to recreate the panel group thingy?

                            I have changed the CMD and PGM and all is good with those, but I wanetd to update the help to suit the changes.

                            I didn't like the auto *ALL defaults for the purge, so I have changed them to be safer and point them to a bogus outq etc, our operators necessitate safety in all things ... I also allowed a -xxx number of days to purge.

                            My command changes:
                            Code:
                                        PARM       KWD(PRGDATE) TYPE(*CHAR) DFT([B][COLOR=#0000ff]-45[/COLOR][/B]) +             
                                                     SPCVAL((*NONE)) +                             
                                                     CHOICE('*NONE,(YYYYMMDD)[B][COLOR=#0000ff],(-xxxx)[/COLOR][/B]') +          
                                                     PROMPT('Purge Before Date[B][COLOR=#0000ff], or -days[/COLOR][/B]:')        
                            Q1:         QUAL       TYPE(*NAME) LEN(10) DFT([B][COLOR=#0000ff]BOGUSOUTQ[/COLOR][/B]) SPCVAL((*ALL))    
                                        QUAL       TYPE(*NAME) LEN(10) DFT([B][COLOR=#0000ff]BOGUSLIB[/COLOR][/B]) +             
                                                     PROMPT('Library:')
                            My RPGLE changes:
                            Code:
                            [B][COLOR=#0000ff]d x               s             10p 0    
                            [/COLOR][/B]
                            // Check For Date Criterion                      
                            If SplFDate <> '*NONE';                          
                             [B][COLOR=#0000ff] If %SubSt(SplFDate : 1 : 1) = '-';             
                                x = %dec(SplFDate : 10 : 0);                 
                                TempDate = %Date + %Days( x );               
                              Else;                                          [/COLOR][/B]
                                TempDate = %Date( SplFDate : *ISO0 );        
                              [B][COLOR=#0000ff]EndIf;                                         [/COLOR][/B]
                              CheckDate = %Char( TempDate : *cymd0 );        
                              If ( CheckDate <= OSPL0300.Date_Created );     
                                Iter;                                        
                              EndIf;                                         
                            EndIf;
                            Greg Craill: "Life's hard - Get a helmet !!"

                            Comment


                            • #15
                              Re: Simple delete old spool files

                              Nix that - got it, it's in the CRTCMD optional parms ...
                              Greg Craill: "Life's hard - Get a helmet !!"

                              Comment

                              Working...
                              X