Sie sind auf Seite 1von 13

The purpose of this booklet is to get you started with dump analysis when there is no

other way - you dont have time to go to a class - you cant find a book on it (because
there are none) - youre in a class on COBOL and your program bombs and produces a
dump.
I assume you have the IBM COBOL-2 compiler and Abendaid. If you have only COBOL1 you can use the listing at the top of the next page.
You have to compile the program with the COBOL compiler options MAP and OFFSET.
FLAG(W,W) is highly desirable too. You need the most recent program listing from the
compile job that produced the program that abended. If you dont have these, dont even
try to analyze the dump.

--------------------------------- Table of Contents ---------------------------------------------- Using Abendaid, how to find verb and data in the dump
COBOL Compile listing
ABENDAID dump
COBOL data types

3
4
7
11

Using Abendaid
Compile listing for COBOL-I

Compile Options MAP,CLIST


Obtain Compile listing. Find part of listing that starts INTRNL NAME (Looks like this)
INTRNL NAME
DNM=1-123
DNM=1-456

SOURCE NAME
INPUT-COUNTER
OUTPUT-COUNTER

BASE
BL=3
BL=3

DISPL DEFINITION
00C
DS 3
00F
DS 3P

Mark or note the base and displacement columns for COBOL data items.
Find part of listing that starts CONDENSED LISTING (Looks like this)
1
2
101 PERFORM
104 MOVE

3
A90
AF4

1
2
102 ADD
105 SUBTRACT

3
AAC
B10

1
2
3
103 PERFORM AD0
106 CLOSE
B2C

Mark or note these on the listing:


1
2
3

the displacement of that verb


the COBOL verb
Source Statement number

Compile listing for COBOL-II

(See next page)

Compile Options NOSSRANGE,MAP,OFFSET,NUMPROC(MIG) - unless installation prefers other.


Obtain Compile listing. Find part of listing that looks something like this, depending on version of
compiler:
SOURCE NAME
INPUT-COUNTER
OUTPUT-COUNTER

BASE
BLW=3
BLW=3

DISPL DEFINITION
00C
DS 3
00F
DS 3P

Mark or note the base and DISPLacement columns for COBOL data items.
Find part of listing that looks more or less like this depending on version of compiler:
1
2
101 PERFORM
104 MOVE

3
A90
AF4

1
2
102 ADD
105 SUBTRACT

3
AAC
B10

1
2
3
103 PERFORM AD0
106 CLOSE
B2C

Mark or note these on the listing:


1
2
3

Source Statement number


the COBOL verb
the displacement of that verb

Just Enough Dump to be dangerous. 2

COBOL Compile Listing


PP5668958IBMVSCOBOLIIRelease4.009/15/92Date02/03/00Time14:25:05Page1
000001000100IDENTIFICATIONDIVISION.
000002000200PROGRAMID.TEST1.
000003000800*
000004000900ENVIRONMENTDIVISION.
000005001000CONFIGURATIONSECTION.
000006001100*
000007001500INPUTOUTPUTSECTION.
000008001600FILECONTROL.
000009001700*
000013002100DATADIVISION.
000014002200FILESECTION.
000015002300*
000039005502*
00004000550301HEADERLINE1.BLW=0000+000
00004100550405FILLERPICX(59)VALUESPACES.BLW=0000+000,0000000
00004200550505FILLERPICX(07)VALUE'PURELY'.BLW=0000+03B,000003B
00004300550605FILLERPICX(10)VALUE'FICTITIOUS'.BLW=0000+042,0000042
00004400550805FILLERPICX(56)VALUESPACES.BLW=0000+04C,000004C
000045005560*
00004600610601COUNTERSALL.BLW=0000+088
00004700610705SAMPLEACCPIC9(04)VALUE0USAGECOMP3.BLW=0000+088,0000000
00004800610805EMPLOYEEACCPIC9(02)VALUE1USAGECOMP3.BLW=0000+08B,0000003
00004900610905PAGENUMACCPIC9(03)VALUE1USAGECOMP3.BLW=0000+08D,0000005
000050006110*
000052006500PROCEDUREDIVISION.
000053006510DISPLAY'PROGRAMTEST1'.
000054006600MOVEALL'!'TOCOUNTERSALL.
000055006610ADD1TOEMPLOYEEACC
000056006620*
000057006630*

Just Enough Dump to be dangerous. 3

DataDivisionMap
DataDefinitionAttributecodes(rightmostcolumn)havethefollowingmeanings:
D=ObjectofOCCURSDEPENDINGG=GLOBALS=Spannedfile
E=EXTERNALO=HasOCCURSclauseU=Undefinedformatfile
F=FixedlengthfileOG=GrouphasownlengthdefinitionV=Variablelengthfile
FB=FixedlengthblockedfileR=REDEFINESVB=Variablelengthblockedfile
SourceHierarchyandBaseHexDisplacementAsmblrDataData
LineIDDataNameLocatorBlkStructureDefinitionDataTypeAttr
2PROGRAMIDTEST1
4001HEADERLINE1...............BLW=0000000DS0CL132Group
4102FILLER.................BLW=00000000000000DS59CDisplay
4202FILLER..................BLW=000003B000003BDS7CDisplay
4302FILLER..................BLW=00000420000042DS10CDisplay
4402FILLER..................BLW=000004C000004CDS56CDisplay
4601COUNTERSALL................BLW=0000088DS0CL7Group
4702ALLEMPLOYEESDIVACC..........BLW=00000880000000DS3PPackedDec
4802EMPLOYEEACC...............BLW=000008B0000003DS2PPackedDec
4902PAGENUMACC..............BLW=000008D0000005DS2PPackedDec

Just Enough Dump to be dangerous. 4

5
LINE#HEXLOCVERBLINE#HEXLOCVERBLINE#HEXLOCVERB
0000530001D8DISPLAY0000540001E6MOVE0000550001ECADD
00006100020AGOBACK
***TGTMEMORYMAP***
TGTLOC
Endofcompilation1,programTEST1,nostatementsflagged.
Returncode0

Just Enough Dump to be dangerous. 5

Abendaid Dump
Finding the verb
Locate the part of the dump that states next sequential instruction to be executed
It will look like this: (see page 8)
next sequential instruction to be executed in program TEST1 was at displacement 1FC
Refer to the verb displacements in the compile listing. (page 6)
Find the highest displacement that is less than the one shown in the dump (AB0)
look at the displacements
1E6 is less than the one shown in the dump (1FC). Try the next higher one.
1EC is less than the one shown in the dump (1FC). Try the next higher one.
20A is greater than the one shown in the dump (1FC). Go back one.
1EC is the displacement you want. It is an ADD. Its source statement number is 55
Look at the compile listing to see the ADD verb in context. Note the data items that it affects.
Finding the offending data in 0C7 dumps.
Locate the part of the dump that states a data exception was caused by data at displacement 08B from the start of
BL cell 00 (page 9)
Refer to the compile listing (page 5) for the COBOL data item at displacement 08B at BL=0.
Youre on your own now. You know the verb and the data in question. Study the program to determine what
happened.

Just Enough Dump to be dangerous. 6

7
ABENDAID
PAGE
TUESDAY03FEB
*****************************************************************
*AbendAIDDiagnostics*
*Copyright(C)1976,1997,CompuwareCorporation.*
*UnpublishedRightsReservedUnderThe*
*CopyrightLawsOfTheUnitedStates.*
*****************************************************************
Model902XOPSYSMVS/SP5JobMYJOB01
CPFMIDCBA0010StepRUNIT
SystemS001Time14.25.13
DFSMS/MVSV1R2M0
JES2SP5
CompletionCodeS0C7
*******************************************
*NextSequentialInstructionSection*
*******************************************
Thenextsequentialinstructiontobeexecutedinprogram
TEST1wasatdisplacement000001FC.
Theprogramwascompiledon03FEBandis00000400byteslong.
ItispartofloadmoduleTEST1.
ThemodulewasloadedfromSTEPLIBlibrary
mytest.LOAD
Itwaslinkeditedon03FEBandis00000890byteslong.
ThelastknownI/Ooperationorcallwasissuedfromprogram
TEST1atdisplacement000001E6.

Just Enough Dump to be dangerous. 7

8
ABENDAID
PAGE2

SupportingEnvironmentalData
AbendPSW078D10008000696CA(TEST1)+000001FC
ProgPSW078D10008000696CA(TEST1)+000001FC
LoadModuleTEST1EntryPointAddress
00006770
ILC06,INTC07LoadPointAddress
00006770
Registersattimeoferror(Descriptionsbasedonresolutionas31bitaddresses)
**********************
*DiagnosticSection*
**********************
ADataExceptionwascausedbydatareferencedatdisplacement08B
fromthestartofBLWcell00(X'0').Thefieldcontains
X'5A5A'.Refertothedatadivisionmapintheprogramlistingto
locatethefieldname.
Thefieldcausingtheexceptionislocatedinatemporaryworkfield
intheTGT.TheactualfieldinerrorisinWorkingStorageof
programTEST1.
Becausetheprogramisreentrant,WorkingStorageislocatedoutside
oftheprogram.
ADataExceptioniscausedwhenacomputational3fieldhas
aninvaliddigit(not09),oritslastbytecontainsaninvalid
sign(notF,C,orD).

Just Enough Dump to be dangerous. 8

9
WorkingStorageSection
WorkingstoragereferencedbyBLWcell0(X'0')
DSPLAddressData
00000000480184040404040404040404040404040404040404040404040404040404040404040
0002000048038404040404040404040404040404040404040404040404040404040D7E4D9C5D3PUREL
0004000048058E840C6C9C3E3C9E3C9D6E4E24040404040404040404040404040404040404040Y
FICTITIOUS
00060000480784040404040404040404040404040404040404040404040404040404040404040
000800004809840404040000000005A5A5A5A5A5A5A

Just Enough Dump to be dangerous. 9

10

Whats that in the Dump?: COBOL Data types


This section will prepare you for the shock of seeing your programs data in the dump. The dump
does not indicate in any way the datatype of what you are looking at. Get familiar with COBOL
data types.
DISPLAY ALPHANUMERIC or Character
COBOL Picture:

PIC XXX

Contains:
On keyboard?
Visible on screen, printer?
Math?

all characters possible


Yes (most characters)
yes, but
some configurations not printable
no

Examples:

ABC

Typical uses:

Everything but arithmetic, subscripts, indexes

123

!23

DISPLAY Decimal, unsigned


COBOL Picture:

PIC 9(5)

Contains:

0-9

On keyboard?
Visible on screen, printer?

yes
yes

Math?

yes, but slow


always positive, no matter what

Example:

123

Typical uses:

Number fields typed in on keyboard


displayed on screen, printer

Just Enough Dump to be dangerous. 10

11
DISPLAY Decimal signed
COBOL Picture:

PIC S9(5)

Contains:

0-9

On keyboard?

yes but signed digit has to be entered as a letter


I'm not suggesting you do that!

Visible on screen, printer?

yes but signed digit appears as a letter

In the final digit the sign + or - is merged with the number causing it to appear as a letter.
+54321 looks like 5432A
-54321 looks like 5432J
Note: +0 looks like {
-0 looks like a space
+2 looks like B
+9 looks like I
-2 looks like K
-9 looks like R
Math?

yes, but slow

Typical uses:

Hardly any justifiable

Just Enough Dump to be dangerous. 11

12
Packed Decimal signed (all packed decimals should be signed)
COBOL Picture:

PIC S9(5) PACKED-DECIMAL


or
PIC S9(5) COMP-3

Contains:
On keyboard?

0-9
no

Visible on screen, printer?

no. looks very strange


in hex, +54321 looks like 54321C

Actual length in bytes

Math?
Typical uses:

length should be odd number

pic s9(5) comp-3 takes up 3 bytes


How to figure display length to packed length
divide by 2
drop decimal fraction
add 1
How to figure packed length to display length
Subtract byte
double it (always gives an odd number)
yes (fast)
Accumulators, counters, subscripts, money,
fields in program or files

Just Enough Dump to be dangerous. 12

13
Binary signed (all binary should be signed)
COBOL Picture

PIC S9(4) BINARY


or
PIC S9(4) COMP

Contains:
On keyboard?

0-9
no

Visible on screen, printer?

no. looks very strange


in hex, 1 looks like 0 1

Actual length in bytes

PIC S9(1) thru S9(4) gives a half word, I.E. two bytes
PIC S9(5) thru S9(9) gives a full word, I.E. four bytes
PIC S9(10) thru S9(18) gives a double word, I.E. eight bytes

Math?

yes (real fast, provided its loaded onto a word boundary)

Typical uses:

Integer accumulators, counters, subscripts,


fields in files (not too common)

Just Enough Dump to be dangerous. 13

Das könnte Ihnen auch gefallen