VSAM Share Options defines the VSAM datasets accessibility among different users. Share options are like the DB2 locking system, by using these options different levels of shared access can be given to different jobs/users on a single VSAM dataset.
Where to Set these options?
Can be set while defining the VSAM cluster using IDCAMS.
These can be included in a predefined DATACLASS and using that data class against the VSAM dataset.
Syntax: SHAREOPTIONS(cross region cross system)
Mandatory? No, If not specified default value would be assigned.
Default Value: SHAREOPTIONS(1 3)
It specifies how a VSAM dataset can be shared among the jobs of a single MVS Image. Values can be from 1 to 4. As an example if there is master file which needs to be accessed by different jobs/users/programs, then by setting the proper Cross region value share level can be managed. If there is only job that requires write access and all others need only read access, then this type of access sharing can be specified here.
It specifies the data sharing between different MVS systems.
What does each of these values indicate?
1 – It is the most restrictive share options where it allows many jobs to read OR only one job to Write it. It is not valid for cross system and it is only valid in cross region. Provides the read and Write Integrity.
2– It allows the multiple jobs read the data set and only One job to write it this it provide only the write integrity, This is also not used for cross system share option.
3 – This is not restrictive which allows multiple users to read & write concurrently. So this does not provide any write or read integrity.
4 – This is same as the option 3 but it refreshes the buffer for each random access.