z/OS DFSMSdfp Utilities
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Sharing data sets

z/OS DFSMSdfp Utilities
SC23-6864-00

Except for VSAM data sets or PDSEs, a data set cannot be updated by more than one job or user at a time without the risk of damaging the data set. Some data sets, particularly system data sets (identified by "SYS1"), are always in use. In order to safely update shared data sets, all but one user must stop updating the data set. After the update is finished, all users will have to re-access the data set. Re-accessing the data set is a function of the program using the data set and may involve closing and reopening the data set, or even freeing and reallocating the data set. Not all programs may be capable of doing this, so it is not always possible to safely update a shared data set.Unfortunately, this serialization mechanism does distinguish between data sets with the same name on different volumes.

You can use the DISP parameter on the DD statement, or the TSO ALLOCATE command, or the equivalent text unit for dynamic allocation (SVC 99) to put a lock on a data set so that you can update the data set. Specify DISP=OLD or DISP=MOD whenever you update a data set other than a PDSE.

If you code DISP=SHR in your JCL or the equivalent on the TSO ALLOCATE command or dynamic allocation, realize that the data set you are updating may be simultaneously updated by another user, resulting in an unusable data set, unless it is a PDSE. Another exception is a PDS. If a second program within the GRSplex tries to open the shared PDS for output (not the update in place option), that program gets a 213 ABEND. This detection of a violation of sharing protocol works even with two data sets with the same name on different volumes or two data sets with the same name and volume serial but on different systems. For these two cases the system does not issue ABEND 213.

This problem has been addressed by some components such as program management (binder, linkage editor), MVS allocation (JCL, SVC 99) and ISPF/PDF. Each component provides its own separate interlock and none of them recognize all the other interlocks. Therefore there is no totally safe way to update a data set allocation with DISP=SHR.

Partitioned data sets further complicate sharing because they have a directory and individual members. These sub-parts are generally protected inside the system ISPF/PDF does provide good protection against changes to members and the directory made by other ISPF/PDF user).

PDSE (partitioned data sets extended) are designed to avoid sharing problems. Consider using them in place of partitioned data sets.

When a volume is shared between unlike operating systems (such as between an MVS system and a VM system with shared DASD), DD statements or TSO ALLOC commands may not be able to stop a volume from being simultaneously updated from the two different systems.

Related reading: For more information about sharing data sets see z/OS DFSMS Using Data Sets.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014