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

Need suggestion on CICS READ UPDATE


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: 126
Location: Bangalore

PostPosted: Fri May 03, 2019 2:23 pm
Reply with quote

Hi,

Need one small suggestion on handling VSAM file in CICS region.

1. This is related to one KSDS VSAM (Non RLS) file allocated in CICS region.
2. While it is allocated to CICS region our one batch program wants to update rec (Shareoption 3 3)

3. Now to do that we are using EXCI and calling one online driver module (which dedicated to do such task, means read and then REWRITE)

4. Now while checking that online driver module I saw that there is READ with UPDATE but post REWRITE there is no UNLOCK. Here is my query. I don't know if I am right or wrong. What I know is if the REWRITE is successful then the file will automatically be unlocked but if the REWRITE fails then auto unlock will not happen and we should explicitly UNLOCK the file.

Is that idea right or wrong? What you guys suggest? We should use explicit unlock or not if rewrite fails?

Thanks
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Sat May 04, 2019 12:35 am
Reply with quote

Quote:
but if the REWRITE fails then auto unlock will not happen and we should explicitly UNLOCK the file.
Have you not seen any SYNCPOINT ROLLBACK? I haven't tested but that should take care of this problem unless you come and tell it don't.
Back to top
View user's profile Send private message
subratarec

Active User


Joined: 22 Dec 2007
Posts: 126
Location: Bangalore

PostPosted: Sat May 04, 2019 10:09 pm
Reply with quote

Hi Rohit,

Thanks for your reply. During the analysis I can see that post rewrite operation flow is assigning the response code and doing RETURN (flow coming back to the calling batch program).

Now in this scenario I guess we are good right ? I mean we have RETURN in the online program that means online task is completed and hence anyway the VSAM resource will be free right?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Tue May 07, 2019 7:52 pm
Reply with quote

I thought you were researching on REWRITE failed Condition. Even it has a RESP , what do you do if it fails ? Do you still RETURN?
Back to top
View user's profile Send private message
subratarec

Active User


Joined: 22 Dec 2007
Posts: 126
Location: Bangalore

PostPosted: Fri May 10, 2019 9:01 am
Reply with quote

Hi Rohit,

Actually the online REWRITE module is an old module which we are not changing but rather calling to get the service. I can see if REWRITE fail happens then it is just passing the RESP code indicating that REWRITE has been failed and then I can see there simple CICS RETURN, which I belive the flow is coming back to batch calling module.

Now in this scenario what I want to check is IF REWRITE fails and with just the response code RETURN happens then what will happen to the FILE? The FILE has been access with UPDATE, means it has been locked and what I know successful REWRITE automatically UNLOCK the file but if REWITE fails and then with RETURN means though the REWITE operation failed but because RETURN our transaction ends hence file will aotomatically been UNLOCKED. Is that concept correct?

Otherwise I will go back to the owner of that online module and may have to suggest an explicit UNLOCK when REWITE fail happens.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Thu May 16, 2019 9:24 am
Reply with quote

Yes when you did the RETURN without TRANSID it means the task is ended permanently which assumes the release of the resources.
Back to top
View user's profile Send private message
subratarec

Active User


Joined: 22 Dec 2007
Posts: 126
Location: Bangalore

PostPosted: Fri May 17, 2019 10:42 am
Reply with quote

Hi Rohit,

Yep thats what I thought but Thanks! for reconfirming the same.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri May 17, 2019 12:50 pm
Reply with quote

quoting the CICS manuals

Quote:
RETURN returns control from an application program either to an application program at the next higher logical level, or to CICSĀ®.



Quote:
yes when you did the RETURN without TRANSID it means the task is ended permanently which assumes the release of the resources.


whenever control is returned to CICS the transaction ends permanently AMEN
any additional parameter passed along wit the RETURN call are irrelevant
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Tue May 21, 2019 12:20 am
Reply with quote

Quote:
any additional parameter passed along wit the RETURN call are irrelevant
No doubt , that's correct. But in the context of the scenario it wasn't relevant to have TRANSID passed when REWRITE failed.
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 Using API Gateway from CICS program CICS 0
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
Search our Forums:

Back to Top