Handling run-time errors
Code Debug TSO intercepts program abends and prevents the system from producing a dump.
When an abend occurs in a program for which the source is available, execution automatically pauses, the execution arrow points to the offending statement, and a message indicating the action to take is displayed.
Following figure is an example of Code Debug TSO responding to an abend.
Code Debug TSO Responding to a S0C7 Abend
COMMAND ===> SCROLL ===> CSR
S0C7 ABEND ENCOUNTERED, USE "AA SNAP" COMMAND FOR ADDITIONAL INFORMATION
000120 ANB DS PL2 > +15 PACKED
000117 TSTB DS PL1 > 1 PACKED
** END **
------ --------------------------------- SOC7 Abend at TRITSTA:70/AMODE 24 <>
000065 ZAP BNC,=P’0’
000066 B PACKIT PACK TSTA,SIDEA PACK TRIANGLE SIDE
000067 PACK TSTB,SIDEB "
000068 PACK TSTC,SIDEC "
000069 ADDIT MVC ANB+1(1),TSTA ADD SIDEA TO SIDEB GIVING ANB
=====> AP ANB,TSTB
000071 MVC ANC+1(1),TSTA ADD SIDEA TO SIDEC GIVING ANC
000072 AP ANC,TSTC
000073 MVC BNC+1(1),TSTB ADD SIDEB TO SIDEC GIVING BNC
To assist you in determining the cause of the abend and how to correct the problem, Code Debug TSO provides the following:
- If Abend-AID Release 7.0.2 or above is installed at your site, you can enter AA SNAP to display an Abend-AID Snapshot report.
- Use the LOG command to display the diagnostic summary contained in the session log.
- Use the HELP command to display help information about the abend.
- Use debugging commands to investigate the cause of the abend.
Displaying the Abend-AID snapshot report
When an abend occurs in your program during a Code Debug TSO test session and Abend-AID is installed at your site, you can display an Abend-AID Snapshot report. This report contains context sensitive diagnostic information. (The report will not contain source support.)
In a nonabending situation, you can request the Snapshot report to display environment specific run-time characteristics and subsystem-related debugging information for VSAM, IDMS, IMS, and Db2 (if you have these Abend-AID options). See Displaying Environmental Data for more information.
To display the Snapshot report, enter AA SNAP on the command line of any run-time screen. The Snapshot report is formatted according to your terminal size (80 or 133) and written to a temporary data set DD called ABENDAID.
Following figure shows the header page of the Snapshot report:
Abend-AID Snapshot Report Header
COMMAND ===> SCROLL ===> CSR
PROGRAM: TRITSTA MODULE: TRIMAINA COMP DATE: 08/23/1995 COMP TIME: 20:32:00
----------------------------------------- SOC7 Abend at TRITSTA:38/AMODE 24 ->
SYS95054.T192629.RA000.FLGDAA1.R0137469 dd ABENDAID line 00000
********************************* TOP OF DATA *********************************
1 A B E N D - A I D S N A P S H O T PAGE 1
0THURSDAY 24 AUG 1995 941201-R08.00.04
*******************************************************************
* A b e n d - A I D S n a p s h o t *
* *
* Copyright (c) 1976, 1994 by Compuware Corporation. *
* Unpublished - Rights Reserved Under The Copyright *
* Laws Of The United States. *
* Licensed for use at:
* YOUR COMPANY NAME *
* Company Number: XXXXXX *
*******************************************************************
Model - 9121 OPSYS - MVS/SP 5.1.0 Job - FLGDAA1
CP FMID - HBB5510 Step - TSOPROC
System - CW01 Time - 19.26.29
DFSMS/MVS - V1R2M0
JES2 - SP 5.1.0
Optionally, you can display a column template at the top of the report by using SET COLS ON. The column template can be useful when viewing records or data. Enter SET COLS OFF (the default) to turn off the column template.
Browsing the snapshot report
The Snapshot report can be browsed using the PF8 (DOWN) and PF7 (UP) keys. You can also bypass the header page and go directly to a specific section of the Snapshot report from the source display. For example, to go directly to the Diagnostic Section, you can enter the following:
AA SNAP; FIND ’DIAGNOSTIC’The Diagnostic Section of the report is displayed, as shown in following figure.
Snapshot Report Diagnostic Section
COMMAND ===> SCROLL ===> CSR
CHARS ’DIAGNOSTIC’ FOUND
----------------------------------------- SOC7 Abend at TRITSTA:38/AMODE 24 ->
SYS95054.T192629.RA000.FLGDAA1.R0137469 dd ABENDAID line 00000
**********************
* Diagnostic Section *
**********************
A Data Exception is caused when a packed decimal operand has an
invalid digit (not 0-9), or its last byte contains an invalid sign
(not F, C, or D).
Specific
Information
Absolute Prog DISPL/ Module DISPL/ DISPL/ Machine
ADDR Name Prog Name EPA Load Len Instruction
0014BEEA TRITSTA 000042 TRIMAINA 000542 000542 6 FA10 C143 C141
AP - add decimal
A-operand (TO field)
0014BFEB TRITSTA 000143 TRIMAINA 000643 000643 2
operand = 00FF
*
The above field is in error
* - Digit is invalid
When you have finished viewing the Snapshot report, press PF3 (END) to return to the source display.
If you inadvertently press PF3 (END) while viewing the Snapshot report, you can enter BROWSE ABENDAID on the command line of the source or session log display to redisplay the Snapshot report.
Viewing the session log
Code Debug TSO records the cause of the abend, the exact location, and a diagnostic summary in the session log. To look at the session log, type LOG on the command line of the Source display screen.
An example of the diagnostic summary in the session log is shown in following figure.
Diagnostic Summary in the Session Log
COMMAND ===> SCROLL ===> CSR
PROGRAM: TRITSTA MODULE: TRIMAINA COMP DATE: 08/23/1995 COMP TIME: 20:32:00
------------------------------------------ SOC7 Abend at TRITSTA:38/AMODE 24 --
12 0014BEA8 13 0014BFA0 14 00142F5E 15 0014BEA
INTERRUPT ADDRESS AT OFFSET 000542 IN LOAD MODULE TRIMAINA
*** SOC7 ABEND IN USER MODULE TRITSTA AT STATE 000038 AT OFFSET 000042
*** ACTIVE APPLICATION MODULE AT TIME OF ABNORMAL TERMINATION IS TRITSTA ***
*** APPLICATION MODULE CONTROL HIERARCHY AT TIME OF ABNORMAL TERMINATION ***
LVL MODULE ENTRY MEMBER RETURN LOCATION FOR MOST RECENT CALL
1 XPEDITER
2 TRIMAINA TRIMAINA TRIMAINA OFFSET 0006E
3 X TRITSTA TRITSTA TRIMAINA
DATA EXCEPTION INTERRUPT INSTRUCTION AND OPERANDS
MNEMONIC ZAP INSTRUCTION FA10C143C141 OP1 00FF
OP2 8F
The first part of the diagnostic summary identifies the error message, PSW, data at PSW, general-purpose registers, offset, and the module in which the error occurred.
The middle part shows the abend type, module name, statement number, offset, paragraph name, and the failing verb. This information is followed by the module stack that identifies the last call that took place.
The last part defines the problem and gives the next sequential instruction to be executed in the Assembler format.
If desired, the load modules can also be displayed by entering SHOW MODULES.
Displaying HELP information
The HELP command can be used to obtain further information to determine the cause and possible resolution of the abend. Any of the most commonly occurring abends (listed as follows) can be entered as a keyword with the HELP command.
SB37S0C4 S001 S106
SD37 S0C5 S013 S213
Following figure shows HELP information for a S0C7.
HELP Information on S0C7
COMMAND ===> SCROLL ===> CSR
PROGRAM: TRITST MODULE: TRIMAIN COMP DATE: 06/18/1997 COMP TIME: 18:05:01
------------------------------------------- SOC7 Abend at TRITST:18/AMODE 31 ->
********************************** TOP OF DATA ********************************
S0C7
Data in a field was of incorrect format for the instruction attempting to
process it.
POSSIBLE CAUSES
1. A data-element was not initialized.
2. JCL error resulted in the wrong file being read into the program.
3. MOVE at group level was executed to a COMP or COMP-3 field. No data
conversion was performed on the element level.
4. The Linkage Section data item was improperly defined.
WHAT TO DO
1. PEEK data-elements in abending statement and MOVE valid data to the file
Analyzing the problem
When an abend occurs, you can use Code Debug TSO debugging commands to investigate the cause of the abend. For example, you can view the contents of the data referenced on the statement causing the abend, analyze the data flow and control structure, and optionally, review the path and data values that lead to the error.
Applying fixes
Even when Code Debug TSO intercepts an abend, you have the opportunity to temporarily apply fixes to the problem and resume execution as if the abend had never occurred. The GO (PF12) command resumes execution. However, there may be times that you will not be able to continue normal program execution until the abend is resolved.
Using all of the information provided by the Abend-AID Snapshot report, you can experiment with possible solutions and test the fixes.
Obtaining a memory dump
If a dump is necessary, the SET DUMP ON command can be issued immediately to direct Code Debug TSO to allow the dump to be written if one of the standard dump DD files (SYSUDUMP, SYSMDUMP, or SYSABEND) is allocated to the test session. The dump file can be dynamically allocated just prior to the issuance of the SET DUMP ON command or could have been preallocated through various methods such as the File Allocation Utility (FAU), the TSO ALLOCATE command, JCL if in Batch Connect, etc. (See Using the File Allocation Utility.)