Terminating connections

A Terminate Identify exit routine must be provided in the ESAP. IMS activates this exit routine when a connection is to be terminated.

Termination of the control region connection can be initiated by IMS, by the external subsystem, or by operator command (/STOP SUBSYS). IMS terminates the connection when it is shutting down. The /STOP SUBSYS command causes the connection to be terminated and also puts it in stopped status. IMS does not allow the connection to be reestablished until a /START SUBSYS command has been processed.

The external subsystem can request that the control region connection be terminated in one of two ways. One way is by posting a termination ECB. IMS provides, on the Identify exit routine invocation, the address of an ECB that is expected to be used by the external subsystem when it is terminating. When the external subsystem posts the termination ECB, IMS, after allowing dependent region connections to quiesce, terminates the connection and also puts the connection in stopped status (as it does for the /STOP SUBSYS command). The second way that the control region connection can be terminated is by activating the IMS-supplied Subsystem Termination Service from an external subsystem exit routine.

After activating the Terminate Identify exit routine in the control region, IMS activates the Subsystem Termination exit routine supplied in the ESAP. This exit routine, which can be thought of as the reverse of the Initialization exit routine, might be used by the external subsystem to reset work areas or free storage, for example.

A dependent region connection is maintained for as long as the region is active unless IMS has been requested, either by the external subsystem or by an IMS /STOP SUBSYS command, to terminate the (control region) connection. In general, it is only when IMS has been requested to terminate the connection that the external subsystem Terminate Identify exit routine is driven for dependent regions. Thus, the exit routine is not necessarily activated when a dependent region terminates. This is true also for the Signoff exit routine. Terminate Identify exit routine invocation always follows Signoff exit routine invocation.

The external subsystem is expected to monitor, through the z/OS® end-of-task exit routines, the IMS TCBs identified to it and to perform the necessary signoff and terminate identify processing when an identified TCB ends.

Terminate Thread exit routine invocation always precedes normal termination of the dependent region connection if the region had a thread to the external subsystem. Thus the Terminate Thread exit routine is activated before the Signoff and Terminate Identify exit routines are activated (if they are) or before the dependent region is terminated.

Since IMS does not allow dependent region connections to exist unless the control region has a connection, the Terminate Identify exit routine is not activated for the control region until after each dependent region has either terminated or had its Terminate Identify exit routine activated.

The Subsystem Termination exit routine is not activated for dependent regions.