What will happen if I use Disp=Shr in the output file?

JES2/3, JCL, utilities.
Post Reply
LalitKumar
New Member
Posts: 6
Joined: Mon Jan 04, 2016 4:10 pm

What will happen if I use Disp=Shr in the output file?

Post by LalitKumar »

Hi,

What will happen if I use Disp=Shr in the output file? Will it act as DISP=NEW or MOD or something else?
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: What will happen if I use Disp=Shr in the output file?

Post by Robert Sample »

It will act as DISP=SHR. When you use this construct, you are telling z/OS that the data set exists already and that you will allow other address spaces access to the data set while you are accessing it. DISP=NEW indicates that the data set does NOT already exist, and DISP=MOD indicates that the data set already exists and that you are appending data to the end of the data set -- neither of these apply in your case.

Depending upon your site, and the type of data set, your write may fail with the system telling you write access is not allowed, or you may be able to write to the data set with unknown impact to other address spaces accessing the data set. In no case is it a good idea to use DISP=SHR when writing output to the data set.
LalitKumar
New Member
Posts: 6
Joined: Mon Jan 04, 2016 4:10 pm

Re: What will happen if I use Disp=Shr in the output file?

Post by LalitKumar »

Thanks Robert. So if I have a COBOL program which uses DISP=SHR but opens the file in output mode, is this allowed?
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.”