IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to know the value in a variable at time of abend?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Tue Jul 30, 2013 12:30 am
Reply with quote

Hi All - Is there any way I can know the value of a variable at the time when program abended. I cant use Xpeditor or Intertest, I want to know the value using the dumps generated.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Jul 30, 2013 12:51 am
Reply with quote

Yes. Determine the address of the variable (the exact method will vary depending on the source language) and locate that address in the dump.
Back to top
View user's profile Send private message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Tue Jul 30, 2013 1:04 am
Reply with quote

thanks Akatsukami.
The address of the variable will be found from the compiled listing, but I am not sure how to search the value of that variable in dump. I am using enterprize cobol.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jul 30, 2013 1:18 am
Reply with quote

Yes -- look at the COBOL compile listing. The Task Global Table (TGT) gives the offset for the BLW cells. Look at the data map for the variable, find the BLW cell number and offset; look up the BLW cell value in the dump. Add the offset to that address and go to the address in the dump; that should be (if everything was done correctly) the hex value for the variable. As long as you know the internal formats for the various formats (COMP, COMP-1, COMP-2, COMP-3) then you will have no problem converting the hex to a data value.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jul 30, 2013 8:06 pm
Reply with quote

Hello,

Until you get comfortable using the addresses of the run, you could re-compile the problem code with an "eye-catcher" immediately before the variable you want to look at in the dump.

Once you find it, use the address to work backward to learn how to determne this address Without the eye-catcher.
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Tue Jul 30, 2013 9:07 pm
Reply with quote

Good idea dick.

After you learn/play with locating the address in the dump I would recommend keeping/adding "eye-catcher" code in your program. I always say - Code as if someone else is going to have to fix a coding problem at 2:00 am! Make it easy to find values in a dump.

Simple "eye-catcher" code likeā€¦
WORKING-STORAGE SECTION.
01 FILLER PIC X(30) VALUE 'PGM XXXXXXXX WS BEGINS HERE'.

01 FILLER PIC X(30) VALUE 'WS-COUNTS BEGINS HERE'.

01 FILLER PIC X(30) VALUE 'WS-SWITCHES BEGINS HERE'.

01 FILLER PIC X(30) VALUE 'COPY XXXXXXXX BEGINS HERE'.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jul 30, 2013 9:18 pm
Reply with quote

Hi Gary,

I cannot remember the last time i put together code that did NOT have Eye-catcher code icon_cool.gif

d
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Wed Jul 31, 2013 2:14 am
Reply with quote

And ask your manager why you don't have a dump formatting tool available. There are lots of them out there that can merge the dump with a compile listing.

I still know how to do it the old-school way (as described by the other responders) but I am lazy and prefer to do it the easy way. icon_cool.gif
Back to top
View user's profile Send private message
John Del

New User


Joined: 27 Apr 2012
Posts: 42
Location: NY

PostPosted: Fri Aug 02, 2013 6:59 pm
Reply with quote

Since you mention Enterprise Cobol, you can recompile your program with the TEST option enabled which would produce an easy to read dump of your working storage variables at the time of the abend or for a coded dump such as CEE3DMP. Give it a try.

pic.dhe.ibm.com/infocenter/pdthelp/v1r1/index.jsp?topic=%2Fcom.ibm.entcobol.doc_5.1%2FPGandLR%2Fui%2Fup6050.html

There can be trade offs in efficiency/module size so you may not want to turnover to production with the TEST option on... though, however, it might be a good/valid reason without having access to an installed debugging tool at your installation.

/*
Back to top
View user's profile Send private message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Sat Aug 10, 2013 5:47 am
Reply with quote

All - Thanks for the reply.

I am still having a problem finding the values. I did the following

Quote:
The reference to table WS-TEXT-LINE by verb number 01 on line 024091 addressed an area outside the region of
the table.
From compile unit XXXXXXX at entry point XXXXXXX at compile unit offset +00046004 at entry offset +00046004
at address 10284D5C.



The definition of table is and the BLW information from the compiled listing

Code:

000902         00761  01  WS-TEXT-LINES.                                            00875    BLW=00000+3D0         0CL2409
000903         00762      05  WS-TEXT-LINE            OCCURS 33 TIMES  BLW=00000+3D0,0000000 0CL73
000904         00763                                  INDEXED BY WS-TEXT-LINE 00877    IDX=00001+000
000905         00764          10  FILLER              PIC X(73).  00878    BLW=00000+3D0,0000000 73C             


As per the steps listed in


From TGT, I got the displacement of INDEXED cell, that was -
Quote:

00D7F4 INDEX CELLS


I searched for TGT of program XXXXXXXX in CEEDUMP.

Quote:

TGT for XXXXXXXX: 13C1A038


As per the steps, I have to add 00D7F4 to 13C1A038, which I did, but in the dump just below the TGT reference for the program XXXXXXXX in CEEDUMP, but I couldnt find the location. Please tell me where I went wrong.

All - I know the issue, I am just trying to understand the dying art of reading dumps.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 12, 2013 2:50 am
Reply with quote

Hello,

Quote:
I am just trying to understand the dying art of reading dumps
A Very Good thing to learn . . . icon_smile.gif

As I mentioned earlier, inserting some EYE-CATCHER(s) would help you learn.

Instead of
Code:
INDEXED BY WS-TEXT-LINE
i'd use
Code:
INDEXED BY WS-TEXT-LINE-INDEX
.
I believe it would be more clear.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts C Compile time time stamps Java & MQSeries 10
Search our Forums:

Back to Top