IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Suggestion on KSDS VSAM READ in CICS


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
subratarec

Active User


Joined: 22 Dec 2007
Posts: 116
Location: Bangalore

PostPosted: Wed Feb 13, 2019 4:42 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2569
Location: NYC,USA

PostPosted: Wed Feb 13, 2019 11:47 pm
Reply with quote

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
View user's profile Send private message
subratarec

Active User


Joined: 22 Dec 2007
Posts: 116
Location: Bangalore

PostPosted: Thu Feb 14, 2019 12:44 am
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2569
Location: NYC,USA

PostPosted: Thu Feb 14, 2019 3:10 am
Reply with quote

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
View user's profile Send private message
subratarec

Active User


Joined: 22 Dec 2007
Posts: 116
Location: Bangalore

PostPosted: Thu Feb 14, 2019 12:40 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2569
Location: NYC,USA

PostPosted: Thu Feb 14, 2019 1:03 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts FILE STATUS - 39 ON VARIABLE LENGTH V... COBOL Programming 2
No new posts How to get RBA value from CICS EVENT CICS 5
This topic is locked: you cannot edit posts or make replies. Sample CICS Webservices Program CICS 1
No new posts Need to read duplicate rows from tabl... DB2 3
No new posts Read 4MB message and split into multi... COBOL Programming 9
Search our Forums:

Back to Top