Would like a Batch package job to COMMIT DELETE and ARCHIVE

Document ID : KB000097996
Last Modified Date : 25/05/2018
Show Technical Document Details
Question:
I would like a sample job that will COMMIT, DELETE and ARCHIVE Packages
1) COMMIT PACKAGES OLDER THAN 365 DAYS.             
2) DELETE PACKAGES OLDER THAN 61 DAYS IF PACKAGE
     STATUS IS INAPPROVAL, DENIED, OR APPROVED.   
3) ARCHIVE PACKAGES OLDER THAN 365 DAYS and delete after the archive.
Answer:
This is a SAMPLE JOB that will:

1) COMMIT PACKAGES OLDER THAN 365 DAYS.             
2) DELETE PACKAGES OLDER THAN 61 DAYS IF PACKAGE
     STATUS IS INAPPROVAL, DENIED, OR APPROVED.   
3) ARCHIVE PACKAGES OLDER THAN 365 DAYS and delete after the archive.
   

//PACKAGE EXEC PGM=NDVRC1,PARM=ENBP1000,DYNAMNBR=1500 
//STEPLIB DD DISP=SHR,DSN=???.C11800.CSIQAUTU 
// DD DISP=SHR,DSN=???.C11800.CSIQAUTH 
// DD DISP=SHR,DSN=???.C11800.CSIQLOAD 
//CONLIB DD DISP=SHR,DSN=???.C11800.CSIQLOAD 
//ENPSCLIN DD * 
COMMIT PACKAGE * 
OPTIONS WHERE OLDER THAN 14 DAYS 

DELETE PACKAGE * 
OPTIONS WHERE OLDER THAN 61 DAYS 
WHERE PACKAGE STATUS IS INAPPROVAL OR DENIED OR APPROVED 
.
ARCHIVE PACKAGE * 
TO DDNAME PKGBKUP 
OPTIONS WHERE OLDER THAN 365 DAYS 
DELETE AFTER ARCHIVE 

/* 
//PKGBKUP DD DSN=???.???.???,DISP=(,CATLG,DELETE), 
// SPACE=(CYL,(100,100),RLSE), 
// STORCLAS=TSO,MGMTCLAS=TSO, 
// DCB=(DSORG=PS,RECFM=VB,LRECL=4200,BLKSIZE=0) 
//C1MSGS1 DD SYSOUT=* MESSAGE OUTPUT 
//C1PRINT DD SYSOUT=* PRINT ACTION FILE 
//SYSOUT DD SYSOUT=* 
//SYMDUMP DD DUMMY 
//SYSUDUMP DD SYSOUT=*