Space announcement This documentation space provides the same content as before, but the organization of the content has changed. The content is now organized based on logical branches instead of legacy book titles. We hope that the new structure will help you quickly find the content that you need.

Handling run-time errors for PL/I


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.

The following figure is an example of Code Debug TSO responding to an abend.

Intercepting an Abend

---------------------------- CODE DEBUG TSO - SOURCE ---------------------------
COMMAND ===>                                                    SCROLL ===> CSR
  S0C7 ABEND ENCOUNTERED, USE "AA SNAP" COMMAND FOR ADDITIONAL INFORMATION
        ** END **



------   -------------------------------- SOC7 Abend at TRITSTP1:9/AMODE 31 <>
=====>         VALIDATE_TRIANGLE: PROC;
000010             A_N_B = A + B;
000011             A_N_C = A + C;
000012             B_N_C = B + C;
000013             IF (B_N_C ¬> A) | (A_N_C ¬> B) | (A_N_B ¬> C)  THEN
------                       TYPE_OF_TRIANGLE = 4;
000014         END VALIDATE_TRIANGLE;
------                                

Important

When an abend occurs in a program that has not been compiled with the CSS PL/I language processor (no source listing is available), the session log is automatically displayed with a message indicating the action to take. For example:

ABEND IN MODULE WITHOUT SOURCE USE AA SNAP COMMAND FOR MORE INFORMATION

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 8.0.4 or above is installed at your site, you can enter AA SNAP to display an Abend-AID Snapshot report.

Important

In order to properly view the Snapshot report, the Abend-AID product must have been installed with LANGTYP=USAUC in the GLOBAL table. For additional information, See to Task 14.9 Modify Batch Global Options in the Abend-AID Advanced Configuration Guide.

  • 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 Release 8.0.4 or above 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 non-abending 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 to 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.

Important

If you want to save the abend information for printing, you must allocate the ABENDAID DD to a permanent data set. This data set must be RECFM=VBA and LRECL=133.

The following figure shows the header page of the Snapshot report:

Abend-AID Snapshot Report Header

|                                                                                
|----------------------- CODE DEBUG TSO - BROWSE -----------------------------   
|  COMMAND ===>                                                  SCROLL ===> C   
|  PROGRAM: TRITST     MODULE: TRIMAIN   COMP DATE: 08/23/95  COMP TIME: 18:05   
|  ---------------------------------------------------S0C7  Abend at TRITST:18   
|  SYS95054.T181542.RA000.FLGDAA1.R0134656                dd ABENDAID  line 00   
| ********************************* TOP OF DATA ******************************   
|1                              A B E N D - A I D                      PAGE 1    
|                                                                                
|    THURSDAY   16 FEB 2023                  H17.02.00             R17.02.00     
|    ***********************************************************************     
|    *              A b e n d - A I D   D i a g n o s t i c s              *     
|    ***********************************************************************     
|    Copyright (C) 1976, 2023, BMC CorporationUnpublished.                    
|    Rights Reserved Under The Copyright Laws Of The United States.              
|                                                                                
|    Licensed for use at: XXXXXX                                                 
|    YOUR COMPANY NAME                                                           
|                                                                                
|    Online Technical Support available athttps://support.bmc.com             
|                                                                                
|    JESID - T0883121       OPSYS     - z/OS   2.4.0       Model   - 8562        
|    Job   - FLGDAA1        DFSMS/MVS - V2R4M0             CP FMID - HBB77C0    
|    Step  - TSOPROC        JES2      - z/OS 2.4           System  - LPAR     
|    Time  - 09.02.27                                                         
+-----------------------------------------------------------------------------

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 the following figure.

Snapshot Report Diagnostic Section

 ---------------------------- CODE DEBUG TSO - BROWSE ---------------------------
COMMAND ===>                                                  SCROLL ===> CSR
                            CHARS DIAGNOSTIC FOUND
----------------------------------------- SOC7 Abend at TRITSTP1:9/AMODE 31 ->
SYS95054.T192629.RA000.FLGDAA1.R0137469                dd ABENDAID  line 00000
                        **********************
                        * Diagnostic Section *
                        **********************

                       Both fields are in error

                       * First field in error *

 The data causing the error is located in a temporary work field.  The
external decimal field cannot be located.

                       * Second field in error *


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.

Important

If you have Abend-AID installed at your site, you can also display the session log from the Snapshot report. An example of the diagnostic summary in the session log is shown in the following figure.

Diagnostic Summary in the Session Log

---------------------------- CODE DEBUG TSO - LOG -------------------------------
COMMAND ===>                                                  SCROLL ===> CSR
PROGRAM: TRITSTP1  MODULE: TRIMAINP  COMP DATE: 08/23/1995  COMP TIME: 20:32:01
------------------------------------------ SOC7 Abend at TRITSTP1:9/AMODE 31 --
  GO
XPD0439 RA304      SOC7 ABEND AT 0826CB96  REASON CODE 00000007

    PSW AT TIME OF ERROR  078D1E00 - 8826CB9C
    GP REGISTERS AT ABEND   0 0017D650   1 0017D580   2 8826CB52   3 0826CFA
                            4 0826B074   5 0017D4A8   6 0017D4A8   7 0017D57
                            8 0017D4A0   9 007D4A0E  10 00233BC0  11 0017D34
                           12 0014DD98  13 0014DB68  14 0014DDB8  15 00233BC
    INTERRUPT ADDRESS AT OFFSET 00210E IN LOAD MODULE TRIMAINP

*** SOC7    ABEND IN USER MODULE TRITSTP1  AT STATE 000010 AT OFFSET 000102
*** ACTIVE APPLICATION MODULE AT TIME OF ABNORMAL TERMINATION IS TRITSTP1 ***

*** APPLICATION MODULE CONTROL HIERARCHY AT TIME OF ABNORMAL TERMINATION  ***
LVL     MODULE   ENTRY    MEMBER        RETURN LOCATION FOR MOST RECENT CALL
1                       CODEDEBG
2     TRIMINP1 TRIMINP1 TRIMAINP  STATE 000030 ANALYZE-NEXT-REC
3  X  TRITSTP1 TRITSTP  TRIMAINP

DATA EXCEPTION INTERRUPT INSTRUCTION AND OPERANDS
  MNEMONIC ZAP   INSTRUCTION F810D0CAD0C8      OP1 D340
                                               OP2 FC


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 (as follows) can be entered as a keyword with the HELP command.

SB14 S0C1 S0C7 S031 S806
SB37 S0C4 S001 S106
SD37 S0C5 S013 S213

The following figure shows specific HELP information for a S0C7 abend.

HELP Information S0C7

----------------------------- CODE DEBUG TSO - HELP ------------------------------
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 to Using the File Allocation Utility.)

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*