In many data centers it is necessary to run certain jobs "ahead of time" on a regular basis (such as run today with the business date of tomorrow). The %%$CALCDTE and %%SUBSTR functions can be used to permit automatic scheduling of such jobs on a daily basis by the Control-M monitor. (The output is in mmddyy format.)
//TOMDAILY JOB (....),BILL,CLASS=A  | 
//* %%SET %%A=%%$CALCDTE %%$ODATE +1  | 
//* %%SET %%DD=%%SUBSTR %%A 7 2  | 
//* %%SET %%MM=%%SUBSTR %%A 5 2  | 
//* %%SET %%YY=%%SUBSTR %%A 3 2  | 
//STEP01 EXEC PGM=IKJEFT01,REGION=1000K,DYNAMNBR=30  | 
//SYSPROC DD DISP=SHR,DSN=CONTROL-M-CLIST-LIBRARY  | 
//SYSPRINT DD SYSOUT=*  | 
//SYSTSPRT DD SYSOUT=*  | 
//SYSTSIN DD *  | 
CTMCJOBS SCHEDLIB(CTM.LIB.SCHEDULE) TABLE(SDP00) -  | 
ODAT(%%MM.%%DD.%%YY)  | 
//  | 
The %%$CALCDTE and %%SUBSTR AutoEdit functions can be used for any date calculation that is needed in a production environment.
If you want to use the WAIT FOR ODATE option, which is described in Ordering Scheduling Jobs, you can use the WAITODAT(YES) parameter.
For example
CTMCJOBS SCHEDLIB(CTM.LIB.SCHEDULE) TABLE(SDP00) - ODAT(%%M.%%D.%%Y) WAITODAT(YES)
causes the job to wait for a specific date before being processed.
Parent Topic |