Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Analysys of COBOL program Listings.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sat May 06, 2006 5:57 pm    Post subject: Analysys of COBOL program Listings.
Reply with quote

HI,

Problem Statement :How I search the value in the variable causing data exception.


I am new to the Environment of Mainframes,I got a Data Exception Abend S0C7,with the following details:

Status of COBOL Program & JCL corresponding to it:

Program : Activated
JCL: Abends with S0C7


Details of CEEDUMP:
A Data Exception was caused by data referenced at displacement 15D from the start of TGT BLF cell 00 (X'0000'). The field contains
X'4040'. Refer to the data division map in the program listing to
locate the field name.

The field causing the exception is located in a data record of program
XXXXXX.

Details of SYSOUT:
The system detected a data exception (System Completion Code=0C7).
From compile unit XXXXXX at entry point XXXXXX at statement 1359offset +0000190A at address 3BA0264A.

By the statement no. (blue color above)I will get the variable name,in the listing, which is causing Data Exception , But how will I get the value in that, & then how to trace the program to resolve the problem

Moreover ,what's the meaning of TGT BLF cell in Details of CEEDUMP.
Back to top
View user's profile Send private message

shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 171
Location: Bangalore

PostPosted: Sun May 07, 2006 12:25 pm    Post subject:
Reply with quote

If you want to get the value in the variable name you can use xpeditor or intertest tool to debug.

There are lot of tools available if you have one of them you can easily solve this type of problem.
Back to top
View user's profile Send private message
sen_1983us

New User


Joined: 21 May 2005
Posts: 18
Location: Hyderabad

PostPosted: Sun Jun 04, 2006 2:45 am    Post subject: Re: Analysys of COBOL program Listings.
Reply with quote

Hi,

You can compile the progam with option TEST(SYM).

so while in creating DUMP you can see the value of the variables

Regards
Senthil
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Mon Jun 12, 2006 12:45 pm    Post subject:
Reply with quote

Find line 1359 in the SYSPRINT of you compiler listing and this is where your program has abended . Fix the problem , mostly non numeric value would have been moved into a numeric field. Fix that, compile and run again.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Jun 08, 2007 9:25 pm    Post subject:
Reply with quote

Hi,

Thanks for the suggestions.

prasadvrk wrote:
Find line 1359 in the SYSPRINT of you compiler listing and this is where your program has abended .

prasadvrk,
Yeah usually I do this way only, but many time the line no. does not provide the exact variable name/s. So some other alternate way for this?

sen_1983us wrote:
You can compile the progam with option TEST(SYM).

sen_1983us,
How & where do we define this parameter? Some more suggestion please.
Back to top
View user's profile Send private message
Pons

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Tue Jun 12, 2007 12:53 pm    Post subject: Re: Analysys of COBOL program Listings.
Reply with quote

In production environment we can't compile using the compiler options. So we have to analyse using the offset one we got from the sysout.

You can use endevor and foot print and find that last f bytes of your offset,
That place of code made this abend. Then we easily find the roor cause.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Jun 12, 2007 5:07 pm    Post subject: Re: Analysys of COBOL program Listings.
Reply with quote

Pons wrote:
.. and find that last f bytes of your offset,


Pons,

What is 'f bytes'?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Jun 12, 2007 5:25 pm    Post subject:
Reply with quote

anuj_model wrote:
Yeah usually I do this way only, but many time the line no. does not provide the exact variable name/s.
Generally a COBOL statement deals with only one or two variables, isn't that exact enough?
Back to top
View user's profile Send private message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 147
Location: Columbia, MO

PostPosted: Tue Jun 12, 2007 9:53 pm    Post subject: Re: Analysys of COBOL program Listings.
Reply with quote

Boy, I remember when being able to read a hexadecimal dump was an art form. sigh.

And sorry that this is so lengthy.

Do you have a product called Abend Aid? Probably not if you are asking us.

The idea is to add the given displacement (15D, in your case) to the address given by the base register. And it is hexadecimal addition, so don't forget your base 16 math.

Then you scan down your dump to the given address and read the instruction, checking the contents of the fields. It really helps when you have a yellow IBM instruction card which shows the hexadecimal equivalents of the commands. Wasn't 5D a MVC?

But even that won't help unless you know enough Assembler to realize that MVC is a Move Character command, and that the first field after the command is the RECEIVING field contents and the second is the sending field contents.

And unless your compile is done with the Assembler listing, that won't help much, because then you have to take the Assembler instruction back to your COBOL code to figure out what fields are being referenced by the abending command.

So how do you do this quickly and easily? You have to know what causes what errors - basically, you have to understand your data.

S0C7 is a data exception. This most commonly means that a numeric value has had something done to it that results in it being placed in an alphanumeric field. So start with your numeric fields. Pic 9(nn) fields are very forgiving, so start your research with your COMP fields (COMP, COMP-3, etc.).

Because you got a S0C7, I can safely assume this is a batch job and you are dealing with standard input files. Input files have copybook layouts. Look at the copybook. Find the "packed" (COMP) fields. Using the layout positions, use File-Aid to scan the file for non-numeric data in these fields.

File-Aid option 8 from the main menu allows you to get a file layout froma copybook. This tells you what position the particular field starts in and how long it is. Here is an example:

Code:
                 09 DL-VAR-NUM01-05           PIC S9(05)V COMP-3. ...
                 09 DL-VAR-NUM02-04           PIC S9(04)V COMP-3. ...
                 09 DL-VAR-NUM03-03           PIC S9(03)V COMP-3. ...
                 09 DL-VAR-CH01-01                    PIC X(01).  ...
                 09 DL-VAR-CH02-18                    PIC X(18).  ...


Here are three packed fields. I go to File-Aid F.8 to get the copybook layout and find where these fields are in the actual file:

Code:
File-AID ---------------------- VIEW LAYOUT ------------ Row 24 to 44 of 1,850
COMMAND ===>                                                  SCROLL ===> CSR 
Layout: MVD.ENVA.PANVALET(DLVAR512)                                           
                                                 FIELD                         
--------- FIELD LEVEL/NAME ---------- -PICTURE- -NUMBER START     END  LENGTH 
      9 DL-VAR-DT05                   X(10)         20     53      62      10 
      9 DL-VAR-NUM01-05               S9(5)         21     63      65       3 
      9 DL-VAR-NUM02-04               S9(4)         22     66      68       3 
      9 DL-VAR-NUM03-03               S999          23     69      70       2 
      9 DL-VAR-CH01-01                X             24     71      71       1 


This tells me that I am looking for my first packed field to start in column 63 for a physical length of 3, ending in column 65. (63, 64, 65 makes three physical columns).

Then, again using File-Aid, I would look for nonnumeric values in these columns. Remember that characters are less than numbers in the mainframe world, so I can search any or all of these columns for data less than zero (for the purpose of this example, I took the liberty of using a different file):

Code:
File-AID -------------  Unformatted Selection Criteria  ------ Row 1 to 1 of 1
COMMAND ===>                                                  SCROLL ===> CSR 
                                                                               
Use END to continue, CANCEL to return to main screen.                         
                                                                               
    AND                                                                       
Cmd /OR Position Length RO                      Data Value                     
--- --- -------- ------ -- ----------------------------------------------------
___      9       3      LT T'0'                                               
************************** END OF SELECTION CRITERIA **************************


And this gives me my offending record (or records, as the case may be).

Code:
File-AID - Edit - MV603.NON.NUMERIC -----------------------------------------------------------------------------------------------
COMMAND ===>                                                                                                      SCROLL ===> CSR 
       ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0-
****** ******************************************************* TOP OF DATA ****************
- - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 31 RECORD(S) NOT SELECTED
000001 D5013290ABC531074057839092061C          E3C                                                                                 
- - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 44 RECORD(S) NOT SELECTED
****** ****************************************************** BOTTOM OF DATA *********


Good luck and happy debugging.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Thu Jun 14, 2007 1:45 pm    Post subject:
Reply with quote

Socker_Dad !

Well done, great answer, very well detailed & comprehensible.
My respekt.

Regards, UmeySan

Btw: MVC = D2
Back to top
View user's profile Send private message
Pons

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Fri Jun 15, 2007 3:45 pm    Post subject: Re: Analysys of COBOL program Listings.
Reply with quote

Hi,
Sorry for the delay, that is not f bytes that is an four bytes.
I dont know how to copy my main frame screen here. so i just copy the content.

CEE3207S The system detected a data exception (System Completion Code=0C7).
From compile unit PL759P at entry point PL759P at compile unit offset +0000BB18 at entry offset +0000BB18 at

address 0006EB18.
<> LEAID ENTERED (LEVEL 05/09/2005 AT 11.27)
<> LEAID PROCESSING COMPLETE. RC=0

So you just copy the last Four bytes fo teh offset. BB18. Then you may use the Endevor Footprint option with the corresponding program list, you find this bytes.

It shows as

ADD 00BB18 so this add cause the problem. in this corresponding line you may find the code which is causing the problem

ADD 1 TO PLOV-IBS-ACTVY-CNT.

Its an Alpha Numeric Character and they try to add...
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Jun 27, 2007 7:38 pm    Post subject:
Reply with quote

Thanks socker_dad. I'll keep your suggestions in mind to deal with next abend/s & will come up with new queris if required.

Thanks Pons.
Quote:
Then you may use the Endevor Footprint option

My site uses CHANGEMAN, so the above option is not availalbe to me, still other suggestion can help in debugging.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us