Exec CICS ReadQ TS
Length (Length of mAnchorAdr)
(mAnchorAdr) is a pointer ...
]but this code works fine .... it happens so tht once in a while the same piece of code gives ASRA abend
mAnchorAdr has the equivilent picture of S9(8) and a length of 4.
You are reading the first 4 bytes of item 1 into it.
Assuming you have the pointer defined in your storage, that will work without any problem.
The nohandle does not affect abends that occur after the EC is done.
If the pointer is used after your read corrupted it, then you will very likely get an abend, which one depends on how you are using the pointer.
If the pointer is supposed to be pointing to the area you want the data returned, you need to use the SET and the length needs to be a data area for the EC to put the length of the item from TS.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
I'd suggest you look for the "bad data" that causes the abend.
Can you cause this abend or does it only happen rarely by different users? If it is repeatable, you can isloate it using whatever debug tool your site uses. If it rarly occurs, you may need to collect a few transaction dumps and work thru them.
A couple of things to look at:
Are all input fields validated properly?
Are all working-storage variables initialized?
Is there any data read (vsam/database) that may not be "clean"?