Diagnosing a PL/I Data-Related Error
This section describes how to use Abend-AID to diagnose a common PL/I error. Abend-AID provides two levels of PL/I support: Extended Language Support (XLS) and basic language support.
Some conditions or characteristics found in PL/I programs restrict the usage of PL/I XLS. See Common Shared Services User/Reference for the PL/I usage restrictions.
Resolving an On-Code 0320 with Extended Language Support
When you generate an Abend-AID report with the applicable language processor in use, program source code can be automatically merged into the report. This process comprises Abend-AID Extended Language Support (XLS).
PL/I XLS provides:
- The source code of the statement in error displayed in the Analysis of Error section. For data-related errors, all PL/I variables in the statement in error are shown with their current values.
- The source code of the statement being executed in the Error Location section.
- The names and contents of all individual PL/I variables in storage displayed in the Program Storage section.
- The source listings for PL/I programs on the calling chain displayed in the Program Listing section with the current statement indicated.
The following procedure shows how to read an extended language report on a common error, an on-code 0320 abend.
Review the Analysis of Error section to determine the cause of the error.First review the Analysis of Error section to find the cause of the error. Usually, all of the information you need is in this section. The source code of the statement in error is displayed, and all variables are shown with the current values. The Analysis of Error section also gives a description of an on-code 0320. This example is a decimal divide exception, which is caused when the divisor is zero. The divisor in the statement in error is MONTH_CODE.
Analysis of Error Section
The user abend code of U3001 was issued by PL/I after normal return from
an error or finish on-unit for error on-code 0320. That on-code
corresponds to the OS completion code of S0CB.
*******************************************
* Analysis of Error *
*******************************************
A Decimal Divide Exception occurred in the following statement:
000065 AVG_HOURS = TOTAL_HOURS / MONTH_CODE;
Current values of fields on abending statement
--- Variable/Attributes ----------- Value----1----+----2----+----3----+----4
CALC_PAYROLL:AVG_HOURS
AUTO FIXED DEC(5,1) +43.0
CALC_HOURS:TOTAL_HOURS
STATIC FIXED DEC(5) +101
PAYROLL:TIME_RECORD.MONTH_CODE
AUTO PIC'99' 00
-------------------------------------------------------------------------------
"#" - Indicates field contains invalid data
A decimal divide exception is caused when the divisor is zero.
Specific Information
CSECT DISPL/ Module DISPL/ DISPL/
ADDR Name CSECT Name EPA Load Len Instruction
06900F2E PAYROLL1 000009DE PAYEXEC 00000A5E 00000A5E 6 FD91 D098 D0C8
DP - divide decimal
A-operand - dividend
00011F18 10 000000101000000000000C
B-operand - divisor
00011F48 2 000C
The above field is in errorReview the Error Location section to find the location of the error.The Error Location section indicates that the statement being executed is contained in procedure CALC_HOURS.
The Error Location section also provides the following information:
- Program’s compile date and length
- Program’s link date and load module length
- Load module name and the load library name
- Location of the last I/O operation or subroutine call, if applicable.
Error Location Section
*******************************************
* Error Location *
*******************************************
The statement being executed was:
000065 AVG_HOURS = TOTAL_HOURS / MONTH_CODE;
This statement is contained in
procedure PAYROLL:CALC_PAYROLL:CALC_HOURS.
The program was compiled on 09 FEB 2004 and is 00000A28 bytes long.
It is part of load module PAYEXEC.
The module was loaded from STEPLIB library CW.AA.TEMPLOA7.
The module was link edited on 09 FEB 2004 and is 00003B30 bytes long.
The last known I/O request or call in the program above was:
000063 OVERTIME_TOTAL.ACCRUED_HOURS = OVERTIME_TOTAL.ACCRUED_HOURS +
OVERTIME_HOURS_WEEKLY;
This statement is contained in
procedure PAYROLL:CALC_PAYROLL:CALC_HOURS.The Analysis of Error and Error Location sections usually provide enough information to resolve the problem. The other sections of the Abend-AID report provide supporting information that can be used to trace the cause of the error.
Find the contents of other variables in your program.To find the contents of other variables, review the Program Storage section in the Abend-AID report. Program storage is formatted by individual variable name in the same order as declared in the program. Variable name, storage type, definition, and current value for each PL/I variable located in storage at the time of the error, are given.
Program Storage Section – Procedure PAYROLL
Variable Storage - Procedure PAYROLL
--- Variable/Attributes ----------- Value----1----+----2----+----3----+----4
1TIME_RECORD
AUTO
2 EMPLOYEE_NUMBER_REMOTE_LOCATION
CHAR(8) 30900200
2 MONTH_CODE
PIC'99' 00
2 EMP_NAME
CHAR(30) SMITH, ROBERT M.
2 GROSS_PAY
CHAR(7) 0232469
2 TOTAL_TAXES
CHAR(5) 01230
2 SALARY_PER_HOUR
CHAR(4) 3200
2 REGULAR_HOURS_WEEKLY
CHAR(3) 018
2 OVERTIME_HOURS_WEEKLY
CHAR(3) 040
2 COMMENT
CHAR(18) 03PNC 0320 SAMPLE
.
.
1 REGULAR_TOTAL
AUTO
2 EMP_NUMBER
CHAR(8) 0
2 ACCRUED_HOURS
FIXED DEC(3,1) +53.0
SORT_EMPL
AUTO CHAR(17) DECEMBER 40140039
NET_PAY
AUTO FIXED DEC(7,2) +67999.00
MONTHS
EXT ENTRY
ADDR
BUILTINProgram Storage Section – Procedure CALC_HOURS
Variable Storage - Procedure CALC_HOURS ---
Variable/Attributes ----------- Value----1----+----2----+----3----+----4
TOTAL_HOURS
STATIC FIXED DEC(5) +101Program Storage Section – Procedure CALC_PAYROLL
Variable Storage - Procedure CALC_PAYROLL
--- Variable/Attributes ----------- Value----1----+----2----+----3----+----4
AVG_HOURS
AUTO FIXED DEC(5,1) +43.0
1 CNTL_STRUCT (0)
CTL
2 TABLE_NAME
CHAR(30) JOHNSTONE, REGINALD B.
2 TABLE_DATA (1:2)
(1) FLT DEC(5) +2.000000E+0
(2) FLT DEC(5) +2.000000E+0
2 TABLE_ACTIVITY
CHAR(18) 02RECORD 2
1 CNTL_STRUCT (-1)
CTL
2 TABLE_NAME
CHAR(30) JONES, KERI, M.
2 TABLE_DATA (1:2)
(1) FLT DEC(5) +1.000000E+0
(2) FLT DEC(5) +1.000000E+0
2 TABLE_ACTIVITY
CHAR(18) 01RECORD 1
1 INVENTORY_RANGE (1:3)
AUTO
2 (1) WAREHOUSE
3 MAX_STOCK
(1) FIXED DEC(4,1) +99.0
3 MIN_STOCK
(1) FIXED DEC(3,1) +88.0
2 (1) ROW_BIN
3 MAX_STOCK
(1) +99.0
3 MIN_STOCK
(1) +88.0
.
2 (3) WAREHOUSE
3 MAX_STOCK
(3) FIXED DEC(4,1) +0.0
3 MIN_STOCK
(3) FIXED DEC(3,1) +0.0
2(3) ROW_BIN
3 MAX_STOCK
(3) +0.0
--- Variable/Attributes ----------- Value----1----+----2----+----3----+----4
3 MIN_STOCK
(3) +0.0
WAREHOUSE_DESCRIPTION
AUTO CHAR(120) DESCRIPTION DESCRIPTION DESCRIPTION DESC
+40 RIPTION DESCRIPTION DESCRIPTION DESCRIPT
+80 ION DESCRIPTION DESCRIPTION DESCRIPTION
WAGES (-2:1,1:2)
AUTO
(-2,1) FIXED DEC(3) +2
(-2,2) FIXED DEC(3) +2
(-1,1) FIXED DEC(3) +0
(-1,2) FIXED DEC(3) +0
(0,1) FIXED DEC(3) +0
(0,2) FIXED DEC(3) +0
(1,1) FIXED DEC(3) +0
(1,2) FIXED DEC(3) +0
1 SECTION_FLAGS
STATIC
2 SECTION1_FLG
BIT(2) B’10’
2 SECTION2_FLG
BIT(2,2) B’00’
2 SECTION3_FLG
BIT(2,4) B’10’
2 SECTION4_FLG
BIT(2,6) B’00’Review other supporting information.Whenever PL/I source listings are available in the source listing data set, XLS provides the source listings for all active PL/I programs with the current statement indicated. This information is shown in the Program Listing section. The following figure shows the program listing for PAYROLL.
Program Listing Section
**********************************************************************
* Program Listing Section - PAYROLL *
**********************************************************************
000059 CALC_HOURS: PROC;
000060 DCL TOTAL_HOURS STATIC FIXED DEC(5);
000061 REGULAR_TOTAL.EMP_NUMBER = OVERTIME_TOTAL.EMP_NUMBER =
EMPLOYEE_NUMBER_REMOTE_LOCATION;
000062 REGULAR_TOTAL.ACCRUED_HOURS = REGULAR_TOTAL.ACCRUED_HOURS +
REGULAR_HOURS_WEEKLY;
000063 OVERTIME_TOTAL.ACCRUED_HOURS = OVERTIME_TOTAL.ACCRUED_HOURS +
OVERTIME_HOURS_WEEKLY;
000064 TOTAL_HOURS = OVERTIME_TOTAL.ACCRUED_HOURS +
REGULAR_TOTAL.ACCRUED_HOURS;
CURR STMT ==>AVG_HOURS = TOTAL_HOURS / MONTH_CODE;
000066 SORT_EMPL = MONTH žž EMPLOYEE_NUMBER_REMOTE_LOCATION;
000067 END CALC_HOURS;Review record information.The File section shows information about all files that are open at the time of the error. This information includes identification of the current record and previous records, when available. DCB and other control block information is also given. Abend-AID displays records using decimal locations, making fields easier to find when using record layouts. File information is provided for all file types, including VSAM and IAM.
You can directly access these files through File-AID from the online File Summary Selection List, which lists multiple open files. Inside a file you have full File-AID edit and browse capabilities.
Types of Basic Language Support
Abend-AID provides non-abending and abending support for PL/I. The type of support your site installs depends on how your PL/I application programs presently terminate following an error.
- Non-abending support: Diagnoses the error and returns control to PL/I. This allows the program to terminate with the appropriate PL/I return code.
Abending Support: Issues a U3001 abend. Abend-AID is then invoked through normal SVC51 processing to diagnose the error. Abending support lets your site avoid coding an IBMBEER or IBMBXITA exit in order to abend in an IMS environment.
When PL/I is used with Language Environment (LE), Abend-AID receives control via LE condition-handling rather than PL/I condition-handling. Therefore, if you are using PL/I exclusively with LE, we recommends that your site install Abend-AID Language Environment support instead of Abend-AID PL/I support.
Resolving an On-Code 0320 with Basic Language Support
When you access a report section through the Abend-AID Viewer, your site’s System Display and Search Facility (SDSF) or printed output without the applicable language processor in use, the report does not provide source-level support for the report. This comprises Abend-AID basic language support.
PL/I basic support provides:
- Diagnostics for all PL/I errors including full ON-UNIT support.
- The procedure name and the displacement of the statement in error. The statement number is given when the GOSTMT compiler option is used.
- The line number when the GONUMBER compiler option is used.
- A call trace showing procedure names and displacements. Statement numbers are shown when the GOSTMT compiler option is used.
- Automatic, static, and other PL/I storage areas. In the automatic storage area, Abend-AID indicates the offset to the main entry point at the time of the PROC block, ON-UNIT, or library procedure transferred control with a CALL or BEGIN statement. Abend-AID shows both the absolute addresses, and their corresponding relative addresses, which match the offsets of the static variables on the variable storage map. Thus, you can directly reference each static variable. The names of the PROC, CSECT, and load module are provided.
The following procedure shows how to read a basic language report on the same error and program that was used in Resolving an On-Code 0320 with Extended Language Support.
Review the Analysis of Error section to identify the error.First review the Analysis of Error section for the analysis of the problem. Usually, all of the information you need is in this section. The Analysis of Error section also gives a definition of an on-code 0320. This example is a decimal divide exception that is caused when the divisor is zero.
Analysis of Error Section
The user abend code of U3001 was issued by PL/I after normal return from
an error or finish on-unit for error on-code 0320. That on-code
corresponds to the OS completion code of S0CB.
*******************************************
* Analysis of Error *
*******************************************
A decimal divide exception is caused when the divisor is zero.
Specific Information
CSECT DISPL/ Module DISPL/ DISPL/
ADDR Name CSECT Name EPA Load Len Instruction
06900F2E PAYROLL1 000009DE PAYEXEC 00000A5E 00000A5E 6 FD91 D098 D0C8
DP - divide decimal
A-operand - dividend
00011F18 10 000000101000000000000C
B-operand - divisor
00011F48 2 000C
The above field is in error
Note: The CSECT and module displacements are not applicable
because the operands are located in storage outside
of the program.Find the name of the procedure in error.Review the Error Location section in your Abend-AID report. The Error Location section identifies the procedure name and the offset of the next sequential instruction to be executed. The GOSTMT compiler option was used to get the statement number.
The Error Location section also provides the following information:
Program’s compile date and length
- Program’s link date and load module length
- Load module name and the load library name
- Location of the last I/O operation or subroutine call, if applicable.
Error Location Section
*******************************************
* Error Location *
*******************************************
The next sequential instruction to be executed was in statement 65 at
offset 00000016C in procedure CALC_HOURS.
The program was compiled on 09 FEB 2004 and is 00000A28 bytes long.
It is part of load module PAYEXEC.
The module was loaded from STEPLIB library CW.AA.TEMPLOA7.
The module was link edited on 09 FEB 2004 and is 00003B30 bytes long.
The last known I/O request or call in the program above was issued with
a return address at displacement 0000097C.Obtain a copy of the correct compiler listing.Make sure that your compiler listing matches the date provided by Abend-AID exactly. Look at the compile date provided in the Error Location section. Compare it to the date in the compiler listing. If you had multiple compiles on that date, then look at the compiled program length that is also provided in the Error Location section.
Compiler Listing – Date
15668-910 IBM OS PL/I OPTIMIZING COMPILER VER 2 REL 3 MOD 0 05 MAR 2004 12:30:39 PAGE 1
-OPTIONS SPECIFIED
0AG,LIST,MAP,OFFSET,STORAGE,A(F),XREF(F),OPT,GOSTMT;
.
.
.
15668-910 IBM OS PL/I OPTIMIZING COMPILER PAYROLL: PROC OPTIONS (MAIN); PAGE 2
- SOURCE LISTING
- STMT
0
1 PAYROLL: PROC OPTIONS (MAIN);
/********************************************************/
/* THIS PROGRAM PROCESSES PAYROLL TIME-CARD RECORDS AND */Look at the source code of the statement in error.The Error Location section provides the number for the statement in error. Look at the program compiler listing and match the statement number.
Compiler Listing – Statement in Error
63OVERTIME_TOTAL.ACCRUED_HOURS = OVERTIME_TOTAL.ACCRUED_HOURS +
OVERTIME_HOURS_WEEKLY;
64 TOTAL_HOURS = OVERTIME_TOTAL.ACCRUED_HOURS +
REGULAR_TOTAL.ACCRUED_HOURS;
65 AVG_HOURS = TOTAL_HOURS / MONTH_CODE;
66 SORT_EMPL = MONTH žž EMPLOYEE_NUMBER_REMOTE_LOCATION;
67 END CALC_HOURS; 68 END CALC_PAYROLL;
69 WRITE_TOTAL:
TOTAL_NET_PAY = TOTAL_CTR;
70 WRITE FILE (OUTLIST) FROM (FINAL_LINE);- Determine the variable in error.The statement in error contains three variables. Refer again to the Analysis of Error section. Abend-AID identifies the cause of the error and the variable causing the decimal divide exception. The Specific Information area of the Analysis of Error section indicates that the B-operand is the field in error. This variable contains X’000C’. The divisor in the statement in error is MONTH_CODE.
Find the contents of other variables in your program.Use Abend-AID to investigate the contents of other variables in your program. In this example, find the contents of RECORD_CTR. Refer to the variable storage map. Find the storage CLASS and HEX offset for RECORD_CTR.
Variable Storage Map
VARIABLE STORAGE MAP -
IDENTIFIER LEVEL OFFSET (HEX) CLASS BLOCK
DYNAMIC_LABEL 1 272 110 AUTO PAYROLL
SORT_EMPL 1 296 128 AUTO PAYROLL
NET_PAY 1 284 11C AUTO PAYROLL
RETCODE 1 280 118 AUTO PAYROLL
EOF 1 288 120 AUTO PAYROLL
REGULAR_TOTAL 1 313 139 AUTO PAYROLL
EMP_NUMBER 1 313 139 AUTO PAYROLL
ACCRUED_HOURS 1 321 141 AUTO PAYROLL
COUNTERS 1 1072 430 STATIC PAYROLL
RECORD_CTR 1 1072 430 STATIC PAYROLL
PAGE_CTR 1 1074 432 STATIC PAYROLL
TOTAL_CTR 1 1076 434 STATIC PAYROLL
LINE_CTR 1 1081 439 STATIC PAYROLLCompiler Listing
9 DECLARE
SORT_EMPL CHAR(17),
NET_PAY FIXED(7,2),
RETCODE FIXED BIN(31,0),
EOF BIT(1) INIT(’0’B);
10 DCL DYNAMIC_LABEL LABEL;
11 DCL MONTHS EXTERNAL RETURNS (CHAR(9));
/********************************************************/
/* FILE OPENS */With the storage class and hexadecimal offset, use the following procedure to find the contents of RECORD_CTR.
- Look at the storage class and procedure block information provided by the PL/I variable storage map for the variable. The class identifies the appropriate storage area to use: automatic or static. The class for RECORD_CTR is STATIC, and the hexadecimal offset is 430.
- Review the Program Storage section of the Abend-AID report. In the static storage area, locate the contents of RECORD_CTR. Use the hexadecimal offset from the variable storage map and the DSPL column in the static storage area to identify the beginning of the variable. In this example, the match indicates that RECORD_CTR was set at 2 (X’002C’).
Program Storage Section
*******************************************************
Static storage for PL/I procedure PAYROLL
in CSECT PAYROLL1 of load module PAYEXEC
Compiled with options: SYSTEM( MVS )
*******************************************************
DSPL Address -------------- Data ---------------
00000 06900F78 E00005B4 06900558 0690060C 0690075C \..............*
00010 06900F88 06900820 06900882 069008AC 0690090E .......b........
.
.
00410 06901388 06900A58 0690090E 06900A82 0690090E ...........b....
00420 06901398 06900ADA 0690090E 06900B04 0690090E ................
00430 069013A8 002C001C 01000040 0C003C88 00000000 ....... ...h....
00440 069013B8 00101C00 00000000 00000001 06900558 ................
00450 069013C8 000002C6 06901440 00000001 01140004 ...F... ........Review record information.The File section shows information about all files that are open at the time of the error. This information includes identification of the current record and previous records, when available. DCB and other control block information is also given. Abend-AID displays records using decimal locations, making fields easier to find when using record layouts. File information is provided for all file types, including VSAM and IAM.
You can directly access these files through File-AID from the online File Summary Selection List, which lists multiple open files. Inside a file you have full File-AID edit and browse capabilities.