The SWAMI
of VSE/VSAM

 

Sharing Questions and Answers
VSAM permits sharing of files and volumes.. What do the Shareoptions do?

VSAM SHAREOPTIONS

VSAM provides five levels of sharing and locking, with increasing sharability (and significant increases in overhead) as you change levels:
SHAREOPTION(1)
This provides the highest level of integrity, READ integrity, since at no time is it possible for a reading task to see data which may be obsolete. To be able to provide this level of integrity, no user is permitted to open a file for any access when it is opened for output by another task, and if the file is opened for input, other tasks can open it for input but no task can open it for output.

Locking is only performed during OPEN and CLOSE, so there is little to no performance impact from this choice.

SHAREOPTION(2)
This provides a high level of integrity, WRITE integrity, since at no time is it possible for any updating task to see data which may be obsolete. To be able to provide this level of integrity, no user is permitted to open a file for output when it is opened for output by another task, and if the file is opened for input, other tasks can open it for input and at most one task can open it for output.

Locking is only performed during OPEN and CLOSE, so there is little to no performance impact from this choice.

SHAREOPTION(3)
This VSAM option provides NO integrity for your data. Shareoption(3) does no VSAM integrity checking and provides no integrity services. Any number of users may open and update the file simultaneously. To ensure integrity, the users must provide their own mechanism to prevent concurrent update of file and control data.

As no checking is done by VSAM, there is no performance impact from this choice. Generally, SHAREOPTION(3) should be used only by subsystems which provide their own integrity checking, such as the VSE Librarian.

SHAREOPTION(4)
This option provides a high level of integrity (WRITE inegrity) for data being updated, while providing no special protection for data only being read. Many tasks in several VSE images can open the file for read access. Simultaneously, one or more than one task in one VSE image may open the file for output. All output users are granted WRITE integrity, but read-only tasks do not have READ integrity.

The cross-system image integrity checking is only done during OPEN and CLOSE, so this incurs little performance impact. However, in order to ensure READ and WRITE integrity for update processing, VSAM will always refresh buffer contents from disk for any GET, and then will LOCK the CI until PUT (or RELEASE) processing. In addition, from the time PUT processing begins until it finishes, the CA will be locked. The locking done is INTERNAL locking, using VSE's lock table.

The extra overhead processing time and I/O activity is as a result of the forced refresing of buffer contents, and not from locking per-se. Clearly, this option adds CPU time and I/O wait time to processing requests.

SHAREOPTION(4 4)
This option extends SHAREOPTION(4) fully across system images, in that tasks in multiple images can open the file for output processing simultaneously.

Processing for SHAREOPTION(4 4) is similar to that for SHAREOPTION(4) in that buffer refresh processing must be done. At the same time, the internal locks done during functional processing requests in SHAREOPTION(4) are forced to become external locks and thus will incur physical I/O delays during the reading and writing of the VSE Lock File.

   
 
Up to the
Q and A
Page
Up to the
Sharing
Q and A Page
E-Mail
The Swami
Go to
The Swami's
Home
 

This entire site -- including all its pages and content --
are the intellectual property of and copyright © 2002-2003 by
Dan Janda, theswami@epix.net