I have been laboring under a delusion for awhile that it is possible to control job run criteria at the application level What I am looking for is a faster way to do this then having to modify every job.
For example, a user requests that an application not run on a specific day. Each job in this application are coded to RUN DAILY. Usually we add a line to each job in the application like this: NORUN <date> or maybe a line that sets the job attribute to REQUEST.
What I am asking is, there a way to do this at the application level?
It would be possible to code a variable at the top of the appl. Put the date in when you don't want it to run.
APPL TEMPLATE BADDAY = 'DEC 28 2016' JOB DPTST001.E CRITICAL RUN ANY NORUN %BADDAY ENDJOB
A different way to handle this would be to put the NORUN BADDAY statement into each job and then add a BADDAY special day to the calendar when it does not need to run. Then it can be turned off easily.
You can add below before the APPL statement:
IF TODAY('specific_date') THEN EXIT
Then the application won't even be created and no job will run.
You may also add NOSCHED on event level, so that the event won't fire on the date.
Hope this helps,
Prior to the appl actually building, 2 ways of the top of my head.
Change the run daily to run %run
Set run=daily at the top of the appl.
Use if today logic to set run=norun any
We played with variations of this:
APPLSTART JSTANAME NORUN ANY IF TODAY('07 JUN,2016') THEN DO RUN DAILY /* EARLYSUB 03:00 */ DELAYSUB NOW PLUS 05 MINUTES /* JOBATTR HOLD */ /* ESPNOMSG AJ ALL COMPLETE APPL(%ESPAPPL..%ESPAPGEN) */ ENDDO ENDJOB
The post complete of the appl does function within the applstart.