Thursday, October 30, 2008

CICS Scheduled task

I've a CICS program which is invoked when CICS is started (either a cold start or a warm start) through a PLT entry "DFHPLT TYPE=ENTRY,PROGRAM=program_name".

Our shop cycles CICS every Sunday. But I wanted to run this program every day at 10 a.m. and again at 10 p.m. So, what I did was, I coded this piece at the end of the program (just before "EXEC CICS RETURN END-EXEC"):

IF WS-TIME > '21.59.59'
EXEC CICS START TRANSID(WS-THIS-TRAN)
REQID(WS-REQID)
AT HOURS(10)
END-EXEC
ELSE
EXEC CICS START TRANSID(WS-THIS-TRAN)
REQID(WS-REQID)
AT HOURS(22)
END-EXEC
END-IF


Thanks to my colleague who taught me this technique.

No comments: