View previous topic :: View next topic
|
Author |
Message |
subratarec
Active User
Joined: 22 Dec 2007 Posts: 126 Location: Bangalore
|
|
|
|
Hi,
I have one clarification on COBOL+CICS read to KSDS VSAM file. Below is the explanation.
1. We have a situation where we will do a sequential read on a KSDS VSAM by using STARTBR in Program A
2. Then flow will hit READ NEXT to get the first rec with UNCOMITTED
3. Once read successful then retrieved data program will process
4. Now LINK to Program B from Program A with the data we retrieved
5. In Program B we will check and gather some more details
6. Corntrol comes back to Program A and filling with updated details
7. Then we used another READ with RIDFLD (for key search in VSAM) with UPDATE
8. Then once we get the needed rec we tried REWRITE with the updated value.
Till point 6 it is ok but the moment it hit point 7, program is abend - APCY. We thought that using UNCOMITTED key word will help us (as it allows simultaneous update) on this but it did not.
It's a Non RLS VSAM. Anyway we changed the logic a bit and have achieved whatever we wanted. But it still leaves a question why is it abending with APCY. Now what I can think of is - As we already have one read pointer on the same file (with the STARTBR and READ NEXT) so CICS will not allow the second read pointer (READ with UPDATE) on the same file and thats the reason it is failing.
Is my understanding correct ? Not sure if the above write up enough to explain the situation.
Thanks |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Did anyone care to check the RESP code for point#7 ? Btw For Non-RLS UNCOMITTED is defaulted and not necessarily need any mention. |
|
Back to top |
|
|
subratarec
Active User
Joined: 22 Dec 2007 Posts: 126 Location: Bangalore
|
|
|
|
Hi Rohit,
Thanks for your reply. Actually the moment it reaches to point 7 the screen hold for few seconds and then CICS abend. I will try to see if we can see the RESP value.
But in general do you think that because 2 reads in same transaction and that is only causing issue?
Thanks |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Without knowing RESP or RESP2 , how do you know what to fix? If I were you I would first debug to know the cause and then find the solution.
Second, I would follow this logic STARTBR , READNEXT and then call program B then do a ENDBR by saving the key. For next update part , do a RESETBR/STARTBR with earlier saved key to position it back with different browse characteristics and do subsequent REWRITE.
But either case please get to the bottom of the problem to know the fix. |
|
Back to top |
|
|
subratarec
Active User
Joined: 22 Dec 2007 Posts: 126 Location: Bangalore
|
|
|
|
Hi Rohit,
The logic you have mentioned below we had adopted the same type of logic to achieve our result.
But I just wanted to know why the other way didn't work. As far as the RESP is concerned we tried with both with DEBUG (we use online INTERTEST tool) and with out that. In both the cases when the flow hit point 7 it just abended with APCY. I checking if I can display the current RESP value so I can see that in CEEMSG.
May be CICS won't allow 2 reads on the same file in the same transaction. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
You had a UNCOMMITTED STARTBR characteristic in point 1 and in point 7!you changed to UPDATE within the same STARTBR and that’s mostly the reason why it happened and as explained you need RESETBR or ENDBR to change the BROWSE characteristics to another one ( in this case UPDATE). |
|
Back to top |
|
|
|