The task end/exit routine is a CICS TRUE (Task Related User Exit) that uses the TASKSTART option in order to obtain control at transaction initiation and termination.
The task end/exit routine determines if the ending transaction owns database sessions or memory. If it does, the task end/exit routine logs off the session and releases memory.
Task end/exit routine processing does not occur for the end of pseudo-conversational transactions because session context is preserved across pseudo-conversational boundaries.