Using Automatic Trap Activation (Code Debug CICS PL/I)
Related topics
This section demonstrates Code Debug’s Automatic Trap Activation (ATA) feature. ATA traps terminal-related transaction abends—but not breakpoints—without the user having an Code Debug session running.
Enabling the ATA feature is optional and is done with the AUTOMATIC_TRAP_ACTIVATION_TRAN_TO_RUN global parameter. With the parameter set to OFF (the default), ATA is deactivated. Setting the parameter to XPED, XPRT, or XPSP activates Automatic Trap Activation.
With ATA activated, if a terminal-related transaction is about to abend, the abend will be trapped and Code Debug will be invoked on the terminal or 3270 Web Bridge session where the transaction was initiated. The transaction used to invoke Code Debug is determined by the value of the AUTOMATIC_TRAP_ACTIVATION_TRAN_TO_RUN global parameter. If the AUTOMATIC_TRAP_ACTIVATION_NOTIFY_USER global parameter is set to YES, a customizable notification/decision screen will first be displayed. If the user decides to debug the abending transaction, the Source Listing (2.L), Break/Abend (2.1), or Assembler Break/Abend (2.20) screen will be displayed, depending on the transaction specified for the AUTOMATIC_TRAP_ACTIVATION_TRAN_TO_RUN parameter and the availability of program source.
Trapping an Abend with ATA
In the following demonstration, the global parameter AUTOMATIC_TRAP_ACTIVATION_TRAN_TO_RUN has been set to XPED, AUTOMATIC_TRAP_ACTIVATION_NOTIFY_USER has been set to YES, and source is available for program CWDEMPE.
- On a blank CICS screen, type XPND and press Enter. A message will be displayed saying either Code Debug is not active or it has been terminated.
On a blank CICS screen, type XPLE and press Enter. The Demonstration Transaction screen shown in the following figure will be displayed:
Demonstration Transaction ScreenXPLE _____ - ENTER EMPLOYEE NUMBER C123
*** COMPUWARE CORPORATION ***
DEMONSTRATION TRANSACTION (PL/1)
ENTER DESIRED EMPLOYEE ABOVE:
00001 - CAUSES ASRA ABEND (DATA EXCEPTION)
00002 - CAUSES AEIM (DSIDERROR)
00003 - CAUSES A WRITE TO TEMPORARY STORAGE
00004 - STARTS UP XPLE AS AN ASYNCHRONOUS TASK
00005 - USED TO SHOW MULTIPLE CSECT SUPPORT
00333 - CAUSES A STORAGE VIOLATION OF A SAA
00999 - ENDS NORMALLYTo cause an ASRA abend, type 00001 and press Enter, the following figure will be displayed. Pressing Clear will allow the transaction abend to occur, while pressing Enter will display the appropriate Code Debug screen for debugging the transaction.
Automatic Trap Activation Screen-------------------------- AUTOMATIC TRAP ACTIVATION ----------------------C123
COMMAND ===>
MODULE: CWDEMPE CSECT: CWDEMPE COMPILED: 09 JUN 2005 - 11:23:48
* * * CODE DEBUG FOR CICS AUTOMATIC TRAP ACTIVATION - BULLETIN * * *
AN ABEND HAS BEEN AUTOMATICALLY TRAPPED AT THIS TERMINAL
PRESS THE ENTER KEY TO CONTINUE DEBUGGING THIS TRANSACTION
OR PRESS THE CLEAR KEY TO ABEND THE TRANSACTION
This portion of the screen can be set up
to present customer-specific information
using global parameters AUTOMATIC_TRAP_ACTIVATION_TEXT_LINE_1, 2, 3
FOR ADDITIONAL INFORMATION TYPE HELP.- Press Enter. The Source Listing screen (2.L) will be displayed with the source of program CWDEMPE positioned to the instruction at which the abend occurred.
At this point, the user would debug the abending transaction as described in Testing without Breakpoints (Code Debug CICS PL/I).