Deleting IFS files

175 pts.
Tags:
IFS
IFS Folder
Would anyone be able to help me with the following code? I modified it to delete entries in a folder older that 35 days from today's date when the program is run. Thanks in advance for any assistance you can offer. PGM DCL &TODAY *CHAR 6 DCL &TODAY2 *CHAR 6 DCL &MBRDATE *CHAR 10 ADDLIBLE TAATOOL /* CONVERT TODAY'S DATE LESS 35 DAYS */ RTVSYSVAL SYSVAL(QDATE) RTNVAR(&TODAY) CHGVAR VAR(&TODAY2) VALUE(&TODAY) ADDDAT DAYS(-35) TOVAR(&TODAY) TOVARFMT(*MDY) + TOVAR2(&MBRDATE) SNDPGMMSG MSG('TODAY = ' *CAT &TODAY2 *CAT ', 35 DAYS + AGO = ' *CAT &MBRDATE) * CHANGE SBMJOB COMMAND BELOW TO DO ACTION(*DLT) AND OBJNAM(*ALL) WHEN */ * READY TO IMPLEMENT */ SBMJOB CMD(TAATOOL/DLTIFS + OBJ('/E900SYS/PRINTQUEUE') + OBJNAM(*ALL) CRTDATE(&MBRDATE *LT) + ACTION(*DLT)) JOB(DLTOLDPQUX) + JOBD(JDE) JOBQ(*LIBL/OPSJOBQ) MONMSG CPF0000 ENDPGM

Software/Hardware used:
V6R1 IFS
ASKED: January 17, 2013  7:37 PM
UPDATED: January 17, 2013  8:01 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Is there a problem with the code? Does it fail to compile or does it throw an error when it runs? Without having TAATOOLS, it's hard to help. -- Tom
    125,585 pointsBadges:
    report
  • northwoods
    Tom,  no it does run, but I can't tell if it is actually doing something as it does not throw out any kind of error.  Right now I am running RTVDIRINF on the directory and there is tons of stuff out there.  Is there a way of doing it without TAATOOLS?
    175 pointsBadges:
    report
  • northwoods
    Tom,  here is the job log as it is running now.    Job . . :   DLTOLDPQUX    User . . :   QSECOFR       Number . . . :   401813                                                                                     >> TAATOOL/DLTIFS OBJ('/E900SYS/PRINTQUEUE') OBJNAM('*.jdedebug.log') CRTDATE      (121312 *LT) ACTION(*DLT)                                                       Object IFSDIRT in QTEMP type *FILE not found.                                   TAATOOL/CVTIFS OBJ('/E900SYS/PRINTQUEUE') PROCSUBDIR(*NO)                         OUTFILFMT(*TYPE2) OUTLIB(QTEMP) USRPRF(QSECOFR) CVTDDIR(*YES)                 Authority *ALL or *AUTL revoked from *PUBLIC.                                   Authority given to user *PUBLIC for object IFSDIRT in QTEMP object type           *FILE.                                                                  
    175 pointsBadges:
    report
  • TomLiotta
    Yes. There are numerous ways discussed in other threads that could be found by searches. For example, Deleting IFS records after so many days from a few days ago mentions three general directions.   Your original question implies deleting files from
    /E900SYS/PRINTQUEUE
    that are older than 35 days. The simplest method is the Qshell utility:
    find /E900SYS/PRINTQUEUE -type f -mtime +35 -exec /usr/bin/rm {} \;
    But I have no idea if that is a good idea for you or not. It can take a lot of resources because of how it works. It depends on how many files are going to be selected and how your environment is configured. You might try running it for much older files first, then run again with the age being cut closer and closer.   Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following