VSAM share options
The VSAM setting that decides whether, and how safely, several jobs or systems can open the same VSAM dataset at once.
Also written SHAREOPTIONS, SHAREOPTIONS(2,3), VSAM sharing, RLS, record level sharing
SHAREOPTIONS is a VSAM setting, given when the dataset is defined with IDCAMS. It has two numbers: the first for sharing between jobs on the same system, the second for sharing between systems.
The first number is the one most people need. With 1, either one job may open the dataset for update, or any number may open it to read, but not both. With 2, one job may update while others read. The readers may not see the very latest changes, but the data is not damaged. With 3 or 4, any number of jobs may update at once, and VSAM leaves it to the programs to avoid overwriting each other, which is risky unless the programs are designed for it.
This explains a common clash. A CICS region has a file open for update, and a batch job that wants to update the same file cannot. The usual answer is to close the file in CICS while batch runs, which is part of many overnight schedules.
Record level sharing, RLS, is the better answer at sites that use it. VSAM then manages sharing record by record through the coupling facility, so CICS and batch can safely update the same file at once.
Where can I learn this hands-on?
Right here, at ZedBank. You take a junior job at a simulated bank and learn each part of the work by doing it, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- VSAMA family of dataset types built for fast record access by key, used where applications need to look records up rather than read them in order.
- KSDSThe most common VSAM dataset type, where every record has a unique key used to find it directly.
- IDCAMSThe utility used to create, list, copy and delete datasets, and the standard tool for anything involving VSAM.
- ENQAn enqueue: the way z/OS reserves a resource, such as a dataset, so two pieces of work do not change it at the same time.
- CICSThe transaction manager that runs online mainframe applications, and the software behind a great many screens bank staff use.
- DEFINE CLUSTERAn IDCAMS command that creates a VSAM file, called a cluster. You give it a name, the kind of file, and the size of the key and the record.