File update and DISP=SHR.

JES2/3, JCL, utilities.
Post Reply
Arun Mani
New Member
Posts: 7
Joined: Tue May 06, 2014 4:06 pm

File update and DISP=SHR.

Post by Arun Mani »

Hi,

How DISP=SHR is differnet than DISP=OLD, in case of updating a sequential file? What will happen in case of concurrent update, by multiple users, for the same sequential file, while that DISP=SHR, will the data be corrupted?
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: File update and DISP=SHR.

Post by William Collins »

If two programs update the same dataset at the same time, because it is DISP=SHR (and nothing else is done to stop it) then you leave yourself open to such excitements as loss of data. This may or may not "corrupt" the file, sometimes it may look as though it works, etc.

Do you have a particular question sitting behind this one? If so, ask it.
Arun Mani
New Member
Posts: 7
Joined: Tue May 06, 2014 4:06 pm

Re: File update and DISP=SHR.

Post by Arun Mani »

I've a file which can be updated from tow different job. It does not matter which job runs first and I am thinking what is the best way of doing it.
zprogrammer
Global Moderator
Global Moderator
Posts: 588
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars

Re: File update and DISP=SHR.

Post by zprogrammer »

For your requirment it is better to use OLD ...

Having a dependecy and executing the jobs in sequence is much better than making the job wait for its resources
zprogrammer
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: File update and DISP=SHR.

Post by Robert Sample »

I've a file which can be updated from tow different job. It does not matter which job runs first and I am thinking what is the best way of doing it.
With DISP=SHR, you are going to discover that the first program's updates applied to the data set will be overlaid with the second program's updates. Hence you will not get all the updates you seem to think would be applied to the data set.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “JCL - Job Control Language.”