Configuring Automatic Session Termination
Related topics
This section explains how to configure Code Debug’s automatic session termination. This feature is also available to transaction routing users.
This task requires the Code Debug CICSinstaller.
Overview
Normally, an Code Debug CICS user will terminate their session before leaving CICS. But if a terminal is disconnected, signed off, or logged off while an Code Debug session is still active, the ID of that terminal will remain assigned to the abandoned (but still active) session. Because another terminal logging on could be assigned the same ID, it is possible for a user to be assigned an active Code Debug session that they are not aware of. The first user may have left the session with program breakpoints set and no sure way of re-accessing the same session to release them.
Code Debug CICS can be set up to automatically terminate an active debugging session when the terminal is signed off, logged off, and/or disconnected.
XSNOFF provides session termination when an EXEC CICS SIGNOFF command is issued. Terminal autoinstall sites can modify their autoinstall exit to terminate any active Code Debug sessions when a user logs off from CICS.
XSNOFF and the terminal autoinstall exit each accomplish automatic session termination by invoking the Code Debug transaction XPN0. This transaction starts program DBUGEND0, which deals with session termination in transaction routing environments. DBUGEND0 then starts program DBUGEND, which terminates any active Code Debug CICS sessions assigned to that terminal’s ID.
Code Debug’s automatic session termination writes messages to transient data destination CSMT when any of the following occur:
- A session is successfully terminated.
- A session is not terminated because the TERMINATE_SESSION_AT_DISCONNECT parameter has been set to NO.
- DBUGEND encounters an error while performing command-level RETRIEVE or GETMAIN commands.
Tasks
To install Code Debug’s automatic session termination feature, follow the instructions given as follows.
Task 2.1 Enable Automatic Session Termination
Code Debug CICS automatic session termination can be established in either or both of the following ways:
By enabling the signoff exit, XSNOFF. This exit is entered after a terminal user signs off from CICS. XSNOFF will terminate any active Code Debug debugging sessions assigned to that terminal.
- For sites using terminal autoinstall, by modifying the exit DFHZATDX (or whatever terminal autoinstall exit is being used). When a terminal is logged off, the modified exit will terminate any active Code Debug debugging sessions assigned to that terminal.
- To use either or both methods of automatic session termination, first do the following:
- Check the values of the following global parameters:
- TRANSID_XPN0 - This is the transaction ID invoked at session termination. The default is XPN0. If a different value is used, that value instead of XPN0 must be defined to CICS as part of step b.
- TERMINATE_SESSION_AT_DISCONNECT - This parameter must be set to YES for Code Debug to terminate active debugging sessions when a terminal is disconnected or logged off. The default is YES.
- Ensure that the following resources have been defined to CICS (during the installation configuration in the applicable “Update the CICS Resource Definitions” task in the Code Debug CICS Installation and Configuration space:
- Program DBUGEND0.
- Program DBUGEND.
- Program DBUGEND1. (Optional. See Configure For Transaction Routing Users)
- Transaction XPN0 (or whatever transaction is specified for the TRANSID_XPN0 global parameter.
- Transaction XPND.
- Check the values of the following global parameters:
- Ensure that programs DBUGEND and DBUGEND0 are link edited into the CPWR.cMXD170.SMXDOccL library.
To enable the XSNOFF exit for automatic session termination at terminal signoff, change the value of the ENABLE_GLOBAL_USER_SIGN_OFF_EXIT global parameter to YES. The default is NO. See Standard Global Table DBUGGBL.
- If your site uses transaction routing, see Configure For Transaction Routing Users.
Sites using terminal autoinstall that want automatic session termination when terminals are logged off should perform the following:
Ensure that dynamic transaction backout is enabled in the region.
Modify the terminal autoinstall exit DFHZATDX (or whatever exit is used at your site) as follows:
- Add the following line of code to DFHZATDX in the “Delete Processing Section” after the IBM Put Delete Code Here comment
- Reassemble and link edit DFHZATDX (or whatever VTAM terminal autoinstall exit is used at your site).
Task 2.2 Configure For Transaction Routing Users
Table DBUGEND1 is a CSECT with DC statements defining all the transactions to start when terminating Code Debug sessions in a static transaction routing environment. The table should contain all the transaction IDs on the local system (TOR) corresponding to the remote transaction XPND. If table DBUGEND1 is not present or does not contain any transaction IDs, transaction XPND is run in the local system when a terminal is logged off or signed off.
Transaction routing users with any release of CICS should perform the following procedure:
Assemble and link edit a table named DBUGEND1 (see the following figure) in the Code Debug load library.
DBUGEND1 Table

1Add the last entry shown only if you will be doing debugging in a TOR and require automatic session termination there.
Add the following transaction resource definitions for the local CICS region (TOR):
CEDA DEFINE TRANSACTION(XPN1) GROUP(XPEDR170)
REMOTESYSTEM(CIC1) REMOTENAME(XPND) DYNAMIC(NO)
CEDA DEFINE TRANSACTION(XPN2) GROUP(XPEDR170)
REMOTESYSTEM(CIC2) REMOTENAME(XPND) DYNAMIC(NO)
CEDA DEFINE TRANSACTION(XPN3) GROUP(XPEDR170)
REMOTESYSTEM(CIC3) REMOTENAME(XPND) DYNAMIC(NO)
.
.
.
CEDA DEFINE PROGRAM(DBUGEND1) GROUP(XPEDR170)
LANGUAGE(ASM) EXECKEY(CICS)