IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Meaning of disp=SHR in SORTOUT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Mon Apr 24, 2006 11:37 am
Reply with quote

hi ,

i want to hav some clarification on disp=shr parameter .
can ane body help me .
wat i learnt from manuals was tat
DISP=SHR ,

this means the file can used by many ....
and its only for read purpose .

but wat i found if i m using sort .
n i give disp=shr for SORTOUT .
job is executing properly .

n data is completely rewritten in the output file .

i want to know how it is working with shr mode .
can anybody help me .

Thanks ,
-Kapil .
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Mon Apr 24, 2006 3:22 pm
Reply with quote

Hi kapil,

DISP=SHR means that the dataset specified already exists,
and that the system is to go search for it, and that you don?t mind if
other jobs are using it at the same time as you. So when the user tries to write/ rewrite there is a chance to do so.

Let me know if u cant get me.... icon_smile.gif
Back to top
View user's profile Send private message
Pollyannaish

New User


Joined: 09 Jul 2005
Posts: 31
Location: Pune, India

PostPosted: Mon Apr 24, 2006 3:33 pm
Reply with quote

Hi Kapil,


DISP=SHR

Multiple reads and Single write-----------

When you give DISP=SHR

Many other job may read the file when your job is modifying the file.

Correct me if I am wrong...
Back to top
View user's profile Send private message
Rock Xu

New User


Joined: 04 Dec 2009
Posts: 15
Location: Shanghai China

PostPosted: Sat Jul 31, 2010 8:57 pm
Reply with quote

Hello, Everyone
So how about specifying a same sysout SD with disp of shr in multiple programs and then run the programs at the same time? Actually I also thought Shr is for read only.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 31, 2010 10:53 pm
Reply with quote

DISP=SHR has nothing to do with read only. DISP=SHR means that multiple people can access the data set at the same time -- as long as they are reading it. However, updates to the data set are not protected -- if two or more people update the data set at the same time, unpredictable results up to and including complete corruption of the data set may occur. But DISP=SHR does not inherently prevent such a situation.

There are times when I have had to compress a PDS while using DISP=SHR; this works as long as others are not using the data set at that time.
Back to top
View user's profile Send private message
santy
Warnings : 1

New User


Joined: 19 Jul 2007
Posts: 22
Location: mumbai

PostPosted: Fri Aug 06, 2010 3:16 pm
Reply with quote

DISP=SHR means dataset already available.

If one job updating the dataset then at same time other jobs can only read the dataset, it will not allow the more than one job update the dataset.

SHR will allow multiple jobs to read dataset at same time.

Hopes this will help to solve ur doubt. :)
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Aug 06, 2010 3:18 pm
Reply with quote

santy wrote:
DISP=SHR means dataset already available.
Not exactly true. I have encountered many a JCL error where a DISP=SHR dataset was not available.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Aug 06, 2010 4:01 pm
Reply with quote

Quote:
If one job updating the dataset then at same time other jobs can only read the dataset, it will not allow the more than one job update the dataset.


Not true either - see Robert's earlier comment -


Quote:
if two or more people update the data set at the same time, unpredictable results up to and including complete corruption of the data set may occur. But DISP=SHR does not inherently prevent such a situation.


Garry
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts SORT deletes the SORTOUT file DFSORT/ICETOOL 8
No new posts ISPF 3.4 edit of a ps file, disp use... TSO/ISPF 3
No new posts More than 1 Include criteria for sing... SYNCSORT 6
No new posts Updating a VSAM file with DISP=OLD JCL & VSAM 8
No new posts what is meaning of the number in dcl PL/I & Assembler 2
Search our Forums:

Back to Top