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

File sharing while CICS UPDATE


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

Active User


Joined: 06 Jun 2009
Posts: 115
Location: UK

PostPosted: Wed Jan 26, 2011 7:37 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jan 26, 2011 7:41 pm
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: 115
Location: UK

PostPosted: Wed Jan 26, 2011 7:43 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Jan 26, 2011 8:11 pm
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: 115
Location: UK

PostPosted: Wed Jan 26, 2011 8:54 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jan 26, 2011 9:33 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Using API Gateway from CICS program CICS 0
Search our Forums:

Back to Top