Date: Tue, 12 Nov 1996 17:17:17 PST
Reply-To: Melvin Klassen <KLASSEN@UVVM.UVIC.CA>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Melvin Klassen <KLASSEN@UVVM.UVIC.CA>
Subject: Re: DISP=SHR
Anthony Ayiomamitis <ayiomami@INTERLOG.COM> writes:
> I read somewhere that DISP=SHR is not what it seems and can
>indeed lock up a library. Unfortunately I cannot recall where I saw
>that posting. I also managed to recreate the problem myself about two
>years ago but I cannot recall how I did it (damn it!).
> I spoke to SAS Tech Support a while back and they did confirm
>that SAS does open up a library in EXCLUSIVE mode in spite of the
>DISP=SHR option and this was because of some SAS quirk behind the scenes.
> Does anyone have any example(s) of the above being accomplished
>and/or any reference to printed material for the same?
> WIth flat files, I have easily modified a file using a data
>step even though the JCL had a DISP=SHR option. I an now trying to
>recreate the same problem with a SAS library. As noted above, I have
>done it before but cannot recollect how I pulled it off.
> Due to a business trip lasting twelve days, I will not be able
>to reply immediately to any questions or comments.
> Many thanks in advance for any help/assistance!
Anthony, the rules are simple:
1. use 'DISP=OLD' when you want to guarantee "exclusive" access
to a dataset, e.g., when a SAS program is writing to a SAS library.
2. use 'DISP=SHR' when you want to allow "simultaneous" jobs
to access the dataset. For example, you could submit two jobs
which "read" from the same SAS library, and do different retrievals.
3. never use 'DISP=SHR' when you have "simultaneous" jobs which
*WRITE* to the same dataset --the dataset could become a "mish-mash"
of (incomplete) data from each job.
Corollary: using 'DISP=SHR' in a *SINGLE* job which writes to the dataset
is "bad" practise -- but it works as if you coded 'DISP=OLD',
i.e., you have "read" and "write" access to the dataset.
4. if you code 'DISP=SHR', and you submit "simultaneous" jobs
which use the *SAME* software, e.g., SAS, to access the dataset,
then it's possible that the software *MAY* (in the case of SAS *DOES*)
use additional methods to achieve "serialization", i.e., to lock-out
the dataset from the second job, while the first job is using the dataset.
5. your gun, your toes. Be careful out there.