Coding a program to be invoked by the CICS task manager
If your exit program sets the task manager bit in the schedule flag word, it is invoked at end-of-task. If you specify TASKSTART on the EXEC CICS ENABLE command for the TRUE, it is invoked at start-of-task, and (providing it does not unset the task manager bit), at end-of-task too.
About this task
To determine whether a particular invocation is at start- or end-of-task, you can examine the CICS® task manager parameters described in CICS task manager parameters. Typically, your program shows interest in task manager events if it needs to save task-related information, such as performance or accounting data, before the task ends.