z/OS DFSMS Using Data Sets
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Reusing a VSAM Data Set as a Work File

z/OS DFSMS Using Data Sets
SC23-6855-00

VSAM enables you to define reusable data sets to use as work files. Define the data set as reusable and specify that it be reset when you open it. You also can reuse a striped VSAM data set.

A data set that is not reusable can be loaded only once. After the data set is loaded, it can be read and written to, and the data in it can be modified. However, the only way to remove the set of data is to use the access method services command DELETE, which deletes the entire data set. If you want to use the data set again, define it with the access method services command DEFINE, by JCL, or by dynamic allocation.

Instead of using the DELETE - DEFINE sequence, you can specify the REUSE parameter in the DEFINE CLUSTER|ALTERNATEINDEX command. The REUSE parameter lets you treat a filled data set as if it were empty and load it again and again regardless of its previous contents.

A reusable data set can be a KSDS, an ESDS, an LDS, or a RRDS that resides on one or more volumes. A reusable base cluster cannot have an alternate index, and it cannot be associated with key ranges. When a reusable data set is opened with the reset option, it cannot be shared with other jobs.

VSAM uses a high-used relative byte address (RBA) field to determine if a data set is empty or not. Immediately after you define a data set, the high-used RBA value is zero. After loading and closing the data set, the high-used RBA is equal to the offset of the last byte in the data set. In a reusable data set, you can reset to zero this high-used RBA field at OPEN by specifying MACRF=RST in the ACB at OPEN. VSAM can use this reusable data set like a newly defined data set.

For compressed format data sets, in addition to the high-used RBA field being reset to zero for MACRF=RST, OPEN resets the compressed and uncompressed data set sizes to zero. The system does not reset the compression dictionary token and reuses it to compress the new data. Because the dictionary token is derived from previous data, this action could affect the compression ratio depending on the nature of the new data.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014