MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DISP=OLD vs DISP=SHR

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
ANDY
Beginner


Joined: 07 Feb 2004
Posts: 127
Topics: 67

PostPosted: Tue Aug 03, 2004 9:11 pm    Post subject: DISP=OLD vs DISP=SHR Reply with quote

I open a file as output in cobol program, In JCL, what's the difference between DISP=old and DISP=shr for using the file?
_________________
cheers,
Andy
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Aug 03, 2004 9:34 pm    Post subject: Reply with quote

Andy,

I already mentioned a couple of times to you about searching before posting. Despite that you post the same topics which are discussed earlier.

http://www.mvsforums.com/helpboards/viewtopic.php?t=1275&highlight=disp=old

http://www.mvsforums.com/helpboards/viewtopic.php?t=1202&highlight=disp=old

http://www.mvsforums.com/helpboards/viewtopic.php?t=1873&highlight=disp=old

Also by now you should be able to look up the manuals for such simple questions.

Check this link which explains in detail about DISP parameter in JCL

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2B631/12.19?DT=20030423085347

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ANDY
Beginner


Joined: 07 Feb 2004
Posts: 127
Topics: 67

PostPosted: Wed Aug 04, 2004 10:55 pm    Post subject: Reply with quote

kolusu:

Thanks for your reminder. But I do not get answer from old topic. I know this is a simple question and I know the difference as you explain before and by reference. What I really want to make clear is that if the dataset has data, when we access it for output, the old data will be deleted or not? What's its effective by using shr and old?
_________________
cheers,
Andy
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Aug 05, 2004 5:13 am    Post subject: Reply with quote

Andy,


Quote:

when we access it for output, the old data will be deleted or not?


If you access DSN as output, the old data will be DELETED. This is true for both DISP=OLD & DISP=SHR

The difference between DISP=OLD and DISP=SHR is the exclusive lock.

With DISP=OLD, you will get exclusive hold of DSN for the entire duration of the Job. It prevents other jobs from accessing the DSN while you are modifying it.

With DISP=SHR, the file can be accessed by others while you are modifying it. This will result in reading of corrupt data.

SO it is always advised to code DISP=OLD for output datasets.

In z/OS 1.5, IBM will ABEND the second user if it tries to OPEN a sequential dataset for OUTPUT with DISP=SHR if some other SHR user already has it open for OUTPUT.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ANDY
Beginner


Joined: 07 Feb 2004
Posts: 127
Topics: 67

PostPosted: Thu Aug 05, 2004 7:43 pm    Post subject: Reply with quote

Dear Kolusu:

Thank you.
_________________
cheers,
Andy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group