View previous topic :: View next topic
|
Author |
Message |
cyrus.e.cabrera
New User
Joined: 25 Jul 2011 Posts: 14 Location: Philippines
|
|
|
|
Hi guys,
I just want to ask help on this matter,
I have this particular code that declares an ABEND Protection Exception.
Code: |
MOVE LT-ONE-LIT TO CC-DTL-IDX
SC-SCR-DISPLAY-IDX
SC-IDX.
|
When I try to move the variable LT-ONE-LIT to SC-SCR-DISPLAY-IDX and SC-IDX that's when the abend happens.
all of this variables have the same data type: S9(4) comp.
SC-***** main variable (elementary item if the term is right): SC-STEP-CONTEXT-AREA
Values moved to SC-STEP-CONTEXT-AREA:
Code: |
SET ADDRESS OF SC-STEP-CONTEXT-AREA TO
ADDR-EXCHANGE-CONTEXT. |
ADDR-EXCHANGE-CONTEXT is a POINTER.
Code: |
LV ---- COBOL DATANAME ---------- -- ATTRIBUTES -- ----+---10----+---20--->
02 ADDR-EXCHANGE-CONTEXT POINTER 'X 2D9785EF |
The statement above is the first occurence of usage of the said variable. No previous moves happened before this.
Thank you and God bless. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Somewhere you are pointing to an address that does not belong to your process.
The problem is not the data type, but rather where it is located.
You need to verify the address as being valid for your run. |
|
Back to top |
|
|
cyrus.e.cabrera
New User
Joined: 25 Jul 2011 Posts: 14 Location: Philippines
|
|
|
|
Hi,
Thank for your immediate response.
May I ask what are the common methods to know if the address is valid? I am new on debugging this kind of problem.
Your help is appreciated. Meanwhile, I will try to track the ADDR-EXCHANGE-CONTEXT on the code since it cannot be seen when not Xpedited. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You definitely need to concentrate on ADDR-EXCHANGE-CONTEXT. It contains an invalid address (pointing to storage to which you don't have access).
You need to find where it is given any values. Where is it defined? If in some other module, you have to check whether it is getting passed correctly to your module.
You have to locate everywhere where it gets set. If it starts off with correct values, you have to "watch" it through to the point where it becomes incorrect.
It might be something "simple" like a bunch of pointers in a copybook and not using the same copybook in different modules. |
|
Back to top |
|
|
cyrus.e.cabrera
New User
Joined: 25 Jul 2011 Posts: 14 Location: Philippines
|
|
|
|
Bill Woodger wrote: |
You definitely need to concentrate on ADDR-EXCHANGE-CONTEXT. It contains an invalid address (pointing to storage to which you don't have access).
You need to find where it is given any values. Where is it defined? If in some other module, you have to check whether it is getting passed correctly to your module.
You have to locate everywhere where it gets set. If it starts off with correct values, you have to "watch" it through to the point where it becomes incorrect.
It might be something "simple" like a bunch of pointers in a copybook and not using the same copybook in different modules. |
Thank you for the advice Bill. As of now, I am having a hardtime pin-pointing the location of the first pass for this variable. I don't have any experience on debugging this kind of PROTECTION EXCEPTION RELATED ABEND.
I think I will look at the parent module of this so that I can check the passing of data. However, I am not confident if I am able to know that the data passed is correct. Moreover, I will definitely try what you have suggested.
I will update this post if I accidentally find the solution.
Godspeed. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
If you have debugging tools installed at your site, such as Xpediter, use them. Otherwise, if the transaction is started at a terminal, try using CEDF to look at the data being passed from calling program to subprogram. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Quote: |
I don't have any experience on debugging this kind of PROTECTION EXCEPTION RELATED ABEND.
I think I will look at the parent module of this so that I can check the passing of data. However, I am not confident if I am able to know that the data passed is correct. Moreover, I will definitely try what you have suggested.
I will update this post if I accidentally find the solution.
|
Don't get hung-up on the particular type of abend. If your pointer were a COMP-3 and you were using it in a calculation and it had a sufficiently invalid value, you'd get a DATA EXCEPTION. You'd have to look for the cause in exactly the same way.
Definitely, if it has come from another module, you must look there. If it goes to other modules before yours, check there.
Somewhere originally it has been given a value which is an address to a piece of storage for you to use. Either it has done that incorrectly, or after that something has clobbered it, or your linkage doesn't match up so it looks "clobbered" when you try to use it.
What you have to do is: find where it first gets a value; check that the value is correct; if yes, check it where it goes off to anywhere else first; check it as it arrives in your module.
Once you have some idea of where it happened, then you can start to narrow it down.
Have a little more confidence. The only way you find it "by accident" is if you start changing code, running, changing again, etc, and stumble on a "fix", without knowing why, how or anything (and it is probably not the full story).
If you go looking for the problem, and you know enough to identify it when you see it, there is no accident involved. |
|
Back to top |
|
|
|