VSAM Share Options
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)
Cross Region:
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.
Cross System:
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.
Example:
//STEP01 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DEFINE CLUSTER – (NAME(HLV.PROD.CST01.CLSTR) – CYLINDERS(20 5) – VOLUMES(VL0002) – RECORDSIZE(80 80) – KEYS(12 0) – SHAREOPTIONS(1 3) – INDEXED ) – DATA – (NAME(HLV.PROD.CST01.DATA) – CISZ(4096) – FREESPACE(20 15) – ) – INDEX – (NAME(HLV.PROD.CST01.INDEX) – ) /* |
Notes:
- If we don’t need any cross system share options to be specified, then we can just ignore it and mention only cross region option. In this case there won’t be any cross system sharing allowed.
SHAREOPTIONS(1)
- LISTCAT can be used to view these options for an existing dataset.