Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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

New User


Joined: 06 Jun 2009
Posts: 99
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: 7996
Location: Bellevue, IA

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

New User


Joined: 06 Jun 2009
Posts: 99
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: 2502
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

New User


Joined: 06 Jun 2009
Posts: 99
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: 7996
Location: Bellevue, IA

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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us