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
 
File sharing while CICS UPDATE

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

Active User


Joined: 06 Jun 2009
Posts: 101
Location: UK

PostPosted: Wed Jan 26, 2011 7:37 pm    Post subject: File sharing while CICS UPDATE
Reply with quote

Hi,

Can program PGM1 read (INPUT mode) a file (KSDS) while PGM2 has opened it to update (OUTPUT mode), in CICS environment?

I am working on file handling options (locks e.g exclusive) and want to know if above is allowed.

Thanks for reading and reply.

Cheers!
zh_lad
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8201
Location: Dubuque, Iowa, USA

PostPosted: Wed Jan 26, 2011 7:41 pm    Post subject:
Reply with quote

Are PGM1 and PGM2 both running in CICS?
Back to top
View user's profile Send private message
zh_lad

Active User


Joined: 06 Jun 2009
Posts: 101
Location: UK

PostPosted: Wed Jan 26, 2011 7:43 pm    Post subject:
Reply with quote

Yes. Both are running in CICS.
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 Jan 26, 2011 8:11 pm    Post subject: Reply to: file share
Reply with quote

As opposed to Batch, files are Opened by CICS either at Startup and/or First Reference.

Depending on the "Operations" settings in the RDO Entry (FCT), this will dictate what can be done to the file. These settings are ADD, BROWSE, DELETE, READ and UPDATE and can also been viewed via a CEMT INQ FILE.

So, PGM2 needs to be able to handle a DUPLICATE KEY condition (if you're writing a new record) but more importantly, PGM2 must read the target record for UPDATE and issue either an immediate REWRITE, DELETE or UNLOCK when the function is other than WRITE.

A Read for UPDATE locks the CI where this record (and other records) are found on the file. So, the bigger the CI, the larger the number of records potentially locked-out on a Read for UPDATE. You would NOT want to hold this UPDATE very long, because other tasks may need a different record located in this same CI, so quick processing of the given record is essential.

If PGM2 is going to issue a DELETE, I would strongly advise that you issue a Read for UPDATE, followed by the DELETE. Don't cut corners by issuing a DELETE without the Read for UPDATE. This could come back to haunt you. icon_wink.gif

HTH....

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

Active User


Joined: 06 Jun 2009
Posts: 101
Location: UK

PostPosted: Wed Jan 26, 2011 8:54 pm    Post subject:
Reply with quote

Thanks for your reply and enlighting on Read for update and DELETE.

What will happend when PGM1 tries to read same record which is being updated/written by PGM2?

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8201
Location: Dubuque, Iowa, USA

PostPosted: Wed Jan 26, 2011 9:33 pm    Post subject:
Reply with quote

Quote:
What will happend when PGM1 tries to read same record which is being updated/written by PGM2?
CICS enforces queueing -- so PGM1 will wait until the updates from PGM2 are complete.
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 ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Is CICS BMS logic on z/OS different ... Andi1982 CICS 2 Fri Dec 01, 2017 1:56 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm

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