Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Continue to LOCK even after the REWRITE statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Jun 02, 2010 3:00 pm    Post subject: Continue to LOCK even after the REWRITE statement
Reply with quote

Hi All,

Would like to know if locking a record in CICS can be continued even after the REWRITE statement is executed.

Scenario:
We are trying to migrate the current system to CICS. In the current system there is logic like this ..

- Read a record and hold it
- Rewrite the record and keep holding the record
- Rewrite the record

Is this possible in CICS ?

At present ...
We tried to use the READ UPDATE option but the statement is erroring out at the second REWRITE with a EIBRESP2 code of 47. Also, due to other requirements we are having the TOKEN option along with the UPDATE.

Thanks in advance ...
Back to top
View user's profile Send private message

Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 998
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Jun 02, 2010 3:10 pm    Post subject:
Reply with quote

Quote:
- Read a record and hold it
- Rewrite the record and keep holding the record
- Rewrite the record


That seems an unusual way to process. The REWRITE will release the lock, as you have seen, so your choices would seem to be to re-READ the record for UPDATE to establish a second lock. This will not prevent some other task getting the record in the intervening period between first REWRITE and second READ, so you might implement (and enforce) an enqueue mechanism around the pairs of READ/REWRITEs to prevent accesses by other tasks.

Garry.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Wed Jun 02, 2010 3:11 pm    Post subject:
Reply with quote

AFAIK, you'll have to read the record for update again after doing the first rewrite.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Wed Jun 02, 2010 3:50 pm    Post subject: Reply to: Continue to LOCK even after the REWRITE statement
Reply with quote

ENQ/DEQ would be another method, although any program which accesses this file would have to participate.

For CICS, you could use the ENQ/DEQ API's.

Bill
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Wed Jun 02, 2010 5:40 pm    Post subject:
Reply with quote

Out of curiosity,
If you have no intention of letting any other process access the record you are rewriting (twice) until after the SECOND rewrite, why are you rewriting it the first time? Consider,
a) after the first rewrite, you don't want any other process to access the updated record, and
b) the process actually DOING the rewrite HAS the record in storage between the first rewrite and the second rewrite.

Why not just eliminate the first rewrite? The record will remain locked until you issue the (previously second) rewrite.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Thu Jun 03, 2010 10:04 am    Post subject:
Reply with quote

Thanks all for your guidance ... icon_smile.gif

Since this feature is not directly possible, we are now looking into the suggestion given by Ronald. Analyzing the programs to see if the first rewrite can be skipped and futher more, if there are any other situations like this ...

Will post in case of any new findings.... icon_wink.gif
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Thu Jun 03, 2010 10:07 am    Post subject:
Reply with quote

@Ronald
Quote:
If you have no intention of letting any other process access the record you are rewriting (twice) until after the SECOND rewrite, why are you rewriting it the first time?
As mentioned in my first post, we are doing a migration. Fortunately or unfortunately... icon_razz.gif ... this logic is already present and supported in the current system ... We were looking into the possiblities of simulating this in CICS.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us