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
 

 

S0C7 because of memory overlapping
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Fri Sep 11, 2009 4:03 pm    Post subject: S0C7 because of memory overlapping
Reply with quote

Hi Experts,

Is there any way through which we can confirm that 2 variables are referencing same memory area.

There are 2 variables say X and Y

X is having some value say 000000000 PIC S9(7)V9(2)
When the program goes to fetch value of veriable Y the value of veriable
changes automatically and therefore job is abending.

There is no relation between X & Y.

I am getting a S0C7 because veraible X has alphanumeric data.THis thing is sure that there is no way I can put alphanumeric value in X as it is defined as S9(7)V9(2) then how it is having alphanumeric data.

Please help me.

Thanks in Advance
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Sep 11, 2009 4:13 pm    Post subject:
Reply with quote

PLEASE post your question in the correct forum.
Or explain to us why this is a JCL problem icon_evil.gif

Topic moved to COBOL forum.
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 Sep 11, 2009 4:37 pm    Post subject:
Reply with quote

Quote:
I am getting a S0C7 because veraible X has alphanumeric data.THis thing is sure that there is no way I can put alphanumeric value in X as it is defined as S9(7)V9(2) then how it is having alphanumeric data.
A COBOL-definition of both the varaibles (X and Y) would serve better to get answers.
Quote:
When the program goes to fetch value of veriable Y the value of veriable changes automatically and therefore job is abending.
Being from IT, please don't say this icon_neutral.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Fri Sep 11, 2009 4:59 pm    Post subject:
Reply with quote

Quote:
Is there any way through which we can confirm that 2 variables are referencing same memory area.
Of course -- I can think of two ways just off the top of my head:
1) Code inspection to see the REDEFINES or RENAME or multiple 01 levels in the FD
2) Review of the compiler output to see the offsets for the variables in the cross reference listing
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Sep 11, 2009 8:28 pm    Post subject:
Reply with quote

Hello,

Quote:
then how it is having alphanumeric data.
The 2 most common reasons are bad data or errors in the code. . .
Quote:
When the program goes to fetch value of veriable Y the value of veriable changes automatically
No, it doesn't. . . "Reading" memory does not change it. . .

You have not provided enough information for us to help. . . Suggest you not look for some exotic problem cause - it is most likely some simple error.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Fri Sep 11, 2009 9:31 pm    Post subject:
Reply with quote

In addition to what others have said, if as you say, there is no relation between X and Y, then there is no overlapping storage. As requested, post the definitions of X, Y, and anything that redefines them, and all relevant code involving X and Y, and please use BBCode for readability (see FAQ).
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Sat Sep 12, 2009 9:54 am    Post subject:
Reply with quote

Hi All,

@expat
Sorry, I posted it in wrong forum.

@Anuj Dhawan
The PIc clasuse of variable X is S9(7)V9(2)
The PIC clause of Y is X(7000)

The variable Y is used to store segments until EOF is received.When the program goes to populate the variable Y the value of X changes on 5 iteration.The value of X changes from 000000000 to 00431+000 on 5th iteration.

@Robert Sample
I have checked all the redefines & renames,there weren't any redefines & renames.

About the second possibility that you are talking I have no cluse to check that.

@dick scherrer
The program is running fine for approximately million policies but is abending only for 1 policy.

I know it sounds a bit wired but this is the fact that the varible is having value 00431+000.

Thank You all.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Sep 13, 2009 4:24 am    Post subject:
Reply with quote

Rgupta,

One other situation that can cause data to myteriously appear in a field, is a table move using a run away subscript.

For example:

You have a 10 element table and your pgm issues "MOVE SOME-DATA TO TBL-FLD(SUB).

If SUB contains 100 or some other value GT the # of entries in your table, SOME-DATA will overlay some other part of your pgm, not the intended tbl field. if you're lucky, the pgm will abend because of "invalid data" at the receiving location. This could be happening to you.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Sun Sep 13, 2009 4:56 am    Post subject:
Reply with quote

Without a better description of the information asked for, we can only guess at where the problem is. Please provide the requested information and do not key it in manually -- copy and paste directly from your program and use BBCode to make it more readable.
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Sun Sep 13, 2009 10:57 am    Post subject:
Reply with quote

Hi All


@Terry Heinze
I cannot post the code because I am in a secured zone and I don't have access to the internet where I am having mainframe access.

@mmwife

I am not using a db2 table its the dataset of a VB format that I am using.

Thank You for your support.
Back to top
View user's profile Send private message
smilingashutosh

New User


Joined: 08 Jun 2006
Posts: 22

PostPosted: Sun Sep 13, 2009 1:37 pm    Post subject:
Reply with quote

Quote:
I am not using a db2 table its the dataset of a VB format that I am using.


It is Cobol Table/Array data he is talking about.
I think if you can provide the whole working storage structure of X and Y including its group variable, people will be able to help you out more on this.
If possible also provide the loop logic where the value is getting changed.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Sun Sep 13, 2009 7:45 pm    Post subject:
Reply with quote

rgupta71 wrote:
I cannot post the code because I am in a secured zone and I don't have access to the internet where I am having mainframe access.
Copy/paste the requested information to a Notepad file using a font like Courier New to preserve spacing, attach the Notepad file to an e-mail addressed to yourself, then paste that Notepad attachment here in a post.
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Mon Sep 14, 2009 3:17 pm    Post subject:
Reply with quote

Hi,

@mmwife

You were right. The variable was having occur clause 4 & it was fetching 6 value which was causing abend.

Thank You all
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Mon Sep 14, 2009 3:35 pm    Post subject:
Reply with quote

Gerat finally you got it working, yup that could be a reason. Thanks for letting us know the final solution used. icon_smile.gif
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Thu Jun 10, 2010 4:50 pm    Post subject: Reply to: S0C7 because of memory overlapping
Reply with quote

Hi Experts,

Again I am having similar kind of issue icon_cry.gif .A S0C7 is coming in a compute statement when one is added to a variable which contains X'000000'.Its PIC clause is S9(5) COMP-3.

Can anybody tell me that what are the other possible reason for this.

Thanks.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Thu Jun 10, 2010 4:59 pm    Post subject:
Reply with quote

A S0C7 abend has one cause and only one cause: you are attempting to do arithmetic with a numeric variable that does not have numeric digits in it. You look at the dump information to find the offset into the program where the S0C7 occurred, find the source listing for that program (or generate one if necessary), and determine which statement is located at that offset. Either fix the data or add code to the program to validate the variables are numeric before doing arithmetic.
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Thu Jun 10, 2010 5:04 pm    Post subject:
Reply with quote

Thanks Robert for your quick response.

Quote:
Either fix the data or add code to the program to validate the variables are numeric before doing arithmetic.


I know a code fix will be needed but for that I need to know which varaible values are getting overlapped in the problem varaible.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Thu Jun 10, 2010 5:12 pm    Post subject:
Reply with quote

That's why you analyze the dump -- it'll tell you what you need to know.
Back to top
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Thu Jun 10, 2010 5:22 pm    Post subject:
Reply with quote

Is there anyway to find out which other variable is accessing that memory area.

Thanks.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Thu Jun 10, 2010 5:29 pm    Post subject:
Reply with quote

Generally adding 1 would not give SOC-7 if the destination field does not have garbage.

Are you sure there are no more index problems? One way to be sure is to have CBL SSRANGE compiler option and running with PARM='/CHECK(ON)'
This would make the program abend as soon as the index overflow occurs and does not corrupt other data values.

We had similiar problem an year back. The program was using 35 arrays and 4 were overflowing.
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
Goto page 1, 2, 3  Next
Page 1 of 3

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Not enough virtual memory is availabl... Vinay Pushpala IBM Tools 16 Tue Sep 13, 2016 4:37 pm
No new posts Sort Card : To get the records with ... pecsakthivel123 DFSORT/ICETOOL 7 Thu Dec 10, 2015 11:54 pm
No new posts issues with memory in programs with c... sivakumar.karthik CICS 4 Thu Aug 13, 2015 8:56 pm
No new posts S0C7 abend not able to locate Rijit COBOL Programming 8 Wed Apr 01, 2015 4:03 pm
No new posts S0C7 Data Exception Error Niti Srivastava ABENDS & Debugging 4 Mon Feb 23, 2015 5:40 pm


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