View previous topic :: View next topic |
Author |
Message |
Sysaron Beginner
Joined: 22 Feb 2004 Posts: 3 Topics: 3 Location: Los Angeles
|
Posted: Sun Feb 22, 2004 6:39 pm Post subject: Can Two people write to the same DISP=SHR file at once? |
|
|
What will the result be if they access/write at same time? |
|
Back to top |
|
|
[bond] Beginner
Joined: 31 Dec 2002 Posts: 28 Topics: 6
|
Posted: Mon Feb 23, 2004 12:17 am Post subject: |
|
|
Quote: | SHR
Indicates that the data set existed prior to this job step and that
another job can share it while this job step uses it. "SHARE" can be
used instead of "SHR". |
Both the jobs can 'access' the file at the same time. However, if one jobs starts 'writing' into the file, the job gets exclusive access to the file (as good as DISP=OLD) and the second job has to wait until the first job finishes. Try to verify this. I may be wrong. |
|
Back to top |
|
|
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Mon Feb 23, 2004 1:34 am Post subject: |
|
|
Data will get corrupted.
Cheers,
Coolman
________
Hondamatic history
Last edited by coolman on Sat Feb 05, 2011 1:34 am; edited 1 time in total |
|
Back to top |
|
|
Maton_Man Beginner
Joined: 30 Jan 2004 Posts: 123 Topics: 0
|
Posted: Mon Feb 23, 2004 6:19 pm Post subject: |
|
|
Bond is right, Coolman is misinformed. _________________ My opinions are exactly that. |
|
Back to top |
|
|
Maton_Man Beginner
Joined: 30 Jan 2004 Posts: 123 Topics: 0
|
Posted: Mon Feb 23, 2004 6:23 pm Post subject: |
|
|
Let me clarify that...
If two people are trying to write to a file allocated DISP=SHR in batch then the first person will get to make their changes while the second one waits, as described by Bond. However, the second person will get their go when the first person is finished writing to the data set and the result may well be the one described by Coolman. You will never get two people writing *simultaneously* to the same data set even if it is allocated DISP=SHR. _________________ My opinions are exactly that. |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Tue Feb 24, 2004 12:39 am Post subject: |
|
|
Quote: |
You will never get two people writing *simultaneously* to the same data set even if it is allocated DISP=SHR
|
Not necessarily true. If the dataset is accessed via BSAM, then you can use NOTE and POINT to specify where in the data set to write. Two programs could update different parts of the dataset simultaneously if opened for update in place. I doubt that occurs much, but it is, or at least used to be theortetically possible. Of course, now if two address spaces open a PDS for output at the same time, the 2nd one will be abended with a 213-50 but sequential data sets are not similarly protected. And if you go down to the EXCP level, you can probably do anything you want.
Also, what about VSAM files? I think they can be safely simultaneously updated with record level locking.
(NB: I've not done any EXCP or VSAM programming, so the above is speculation) |
|
Back to top |
|
|
Maton_Man Beginner
Joined: 30 Jan 2004 Posts: 123 Topics: 0
|
Posted: Wed Feb 25, 2004 9:14 pm Post subject: |
|
|
Ok. Maybe I was a bit hasty...read the DFSMS: Using Data Sets manual and search on DISP=SHR. You will find lots of information on it.
Basically, what I said is true if you do what you're supposed to do (use proper system controls and access methods). That being said if you break 'the rules' or operate outside those controls you could end up with a corrupted mess. _________________ My opinions are exactly that. |
|
Back to top |
|
|
|
|