185 pts.
 How to delete data from IFS directory?
How to write the program for deletion of data from IFS directory?

Any cl program?

 



Software/Hardware used:
ASKED: September 3, 2010  7:49 AM
UPDATED: September 3, 2010  7:24 PM

Answer Wiki:
Here is some code for you <pre> PGM PARM(&PDIR) DCL VAR(&PDIR) TYPE(*CHAR) LEN(512) DCL VAR(&DIR) TYPE(*CHAR) LEN(514) DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) DCL VAR(&MSGDATA) TYPE(*CHAR) LEN(256) DCL VAR(&NULL) TYPE(*CHAR) LEN(50) VALUE(X'00') DCL VAR(&STRLENGTH) TYPE(*CHAR) LEN(5) + VALUE('00256') DCL VAR(&EMPTYSTR) TYPE(*CHAR) LEN(50) VALUE(' ') DCL VAR(&DIRNEW) TYPE(*CHAR) LEN(256) DCL VAR(&MAX_TRIES) TYPE(*DEC) LEN(2 0) VALUE(10) DCL VAR(&TRIES) TYPE(*DEC) LEN(2 0) /* Add '/*' to dir name to remove objects in the dir. */ CHGVAR VAR(&DIR) VALUE(&PDIR *TCAT '/*') /* First remove the objects. */ top: DEL OBJLNK(&DIR) MONMSG MSGID(CPFA0BD CPFA093) /* Then remove subdirs. */ RMDIR DIR(&DIR) RMVLNK(*YES) MONMSG MSGID(CPFA093) /* For the subdirs that are not empty, call this same command */ MONMSG MSGID(CPFA0B7) EXEC(DO) RCVERR: RCVMSG MSGTYPE(*DIAG) MSGDTA(&MSGDATA) MSGID(&MSGID) IF COND(&MSGID *EQ ' ') THEN(GOTO + CMDLBL(CONTINUE)) IF COND(&MSGID *EQ CPFA0AC) THEN(DO) CHGVAR VAR(&DIRNEW) VALUE(%SST(&MSGDATA 5 251)) DELDIR PDIR(&DIRNEW) ENDDO GOTO CMDLBL(RCVERR) ENDDO CONTINUE: RMDIR DIR(&PDIR) MONMSG MSGID(CPFA093 CPFA0AC) EXEC(DO) IF COND(&TRIES *LT &MAX_TRIES) THEN(DO) CHGVAR VAR(&TRIES) VALUE(&TRIES + 1) GOTO CMDLBL(TOP) ENDDO ENDDO END: ENDPGM</pre>
Last Wiki Answer Submitted:  September 3, 2010  7:24 pm  by  CharlieBrowne   32,835 pts.
All Answer Wiki Contributors:  CharlieBrowne   32,835 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

By entering “ifs delete file” in the searchbox of this very site (ITKnowledge Exchange) I found this for you:

delete old IFS files :
http://itknowledgeexchange.techtarget.com/itanswers/delete-old-ifs-files/

Delete files from IFS based on last used age :
http://itknowledgeexchange.techtarget.com/itanswers/delete-files-from-ifs-based-on-last-used-age/

delete records from a directory with IFS root using CL :
http://itknowledgeexchange.techtarget.com/itanswers/delete-records-from-a-directory-with-ifs-root-using-cl/

Pls be more specific if you need more help :-)

DanF

 2,540 pts.