View previous topic :: View next topic
|
Author |
Message |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
PLEASE post your question in the correct forum.
Or explain to us why this is a JCL problem
Topic moved to COBOL forum. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
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 |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
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 |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
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 |
|
|
smilingashutosh
New User
Joined: 08 Jun 2006 Posts: 22
|
|
|
|
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
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 |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Gerat finally you got it working, yup that could be a reason. Thanks for letting us know the final solution used. |
|
Back to top |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Hi Experts,
Again I am having similar kind of issue .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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
That's why you analyze the dump -- it'll tell you what you need to know. |
|
Back to top |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Is there anyway to find out which other variable is accessing that memory area.
Thanks. |
|
Back to top |
|
|
Bharath Bhat
Active User
Joined: 20 Mar 2008 Posts: 283 Location: chennai
|
|
|
|
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 |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Thanks Bharath.
One more question.
Where I can see the name of the array's that are having overflow in it. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Bharath Bhat wrote: |
Generally adding 1 would not give SOC-7 if the destination field does not have garbage. |
rgupta71 wrote: |
...when one is added to a variable which contains X'000000'. Its PIC clause is S9(5) COMP-3. |
Looks like garbage to me..... |
|
Back to top |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
CICS Guy ,You are right .I also found this statement to be incorrect.
Thanks. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Using a variable with a value of X'000000' that is defined as PIC S9(05) COMP-3 for arithmetic will automatically generate a S0C7 abend. X'000000' is not a valid numeric value for COMP-3 data. |
|
Back to top |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Yes,this what the problem is.Due to some memory overlapping it is having some junk data.
Thanks |
|
Back to top |
|
|
|