Running bi-monthly history maintenance job, using criteria:
RDRON GT TODAY LESS 2 WEEKS
It works fine for job reports as it will keep the last 2 weeks job information.
However, the above criteria won't keep any APPLREPORT data. You can only do an APPLREPORT back to the date that the last HISTFILE maintenance job ran. How do you add Criteria for APPLREPORT data in HISTFILE maintenance job?
This is because RDRON is JOB criteria field and STARTDATE is APPLICATION criteria field. You will not be able to use only one REPORT in a bi-monthly maintenance job. If you want both JOB and APPL history data selected you have to use one for JOBs and one for APPLs.
Before CA Workload Automation EE r11.3, you only had JOB REPORT in a bi-monthly histfile maintenance job. The JOB REPORT is repro'ed back into the HISTFILE. This is why you will not have bi-monthly history of applications in the histfile after the maintenance job.
You have to add another REPORT statement for applications to the bi-monthly HISTFILE maintenance job. This is so both job and application history records will be kept. You will need to use extend in the SYSIN data on the COPY statement. Also, you will use the same 'SELECT/REJECT' datasets for both reports. The second application report will add values to the output of the previous job report (using the EXTEND keyword on COPY statement).
Here is an example of how you can extend your HISTMNT step:
// IF (RC EQ 0) THEN //HISTMNT EXEC PGM=ESP,PARM='SUBSYS(ESPX)' //STEPLIB DD DSN=ESP.SSCPLINK,DISP=SHR //SYSPRINT DD SYSOUT=* //SYSIN DD * REPORT INPUT DATASET(ESP.HISTFILE) COPY SELECT + DATASET(ESP.HIST.SELECT) COPY REJECT + DATASET(ESP.HIST.REJECT) CRITERIA + RDRON GT TODAY LESS 2 WEEKS ENDR REPORT APPLREPORT INPUT DATASET(ESP.HISTFILE) COPY SELECT EXTEND + DATASET(ESP.HIST.SELECT) COPY REJECT EXTEND + DATASET(ESP.HIST.REJECT) CRITERIA + STARTDATE GT TODAY LESS 2 WEEKS ENDR /* // ENDIF //*