Using the REPRO method
If the recoverable data set you want to move has not been used in RLS mode, you can use access method services commands to perform a number of actions on it.
About this task
These actions include:
- Create a new data set
- Copy (REPRO) the data from the old data set to the new
- Delete the old data set
- Rename the new data set back to the old
In the case of a non-RLS mode data set, retained locks are not a problem and no other special action is needed.
The following
access method services examples assume that CICS.DATASET.A needs
to be redefined and the data moved to a data set named CICS.DATASET.B,
which is then renamed:
DEFINE CLUSTER (NAME(CICS.DATASET.B) …
REPRO INDATASET(CICS.DATASET.A) OUTDATASET(CICS.DATASET.B)
DELETE CICS.DATASET.A
ALTER CICS.DATASET.B NEWNAME(CICS.DATASET.A)If
the recoverable data set has associated RLS locks, these steps are
not sufficient because:
- The REPRO command copies the data from CICS®.DATASET.A to CICS.DATASET.B but leaves the locks associated with the original data set CICS.DATASET.A.
- The DELETE command deletes both the original data set and its associated locks.
- After you issue the ALTER command, the data set has been moved but the new data set does not have any associated locks, which have been lost when you deleted the original data set.
To enable you to move data and keep the locks associated with the data, access method services provide the following SHCDS subcommands. These are subcommands of the VSAM sharing control SHCDS command and must always be preceded by the SHCDS keyword:
- SHCDS FRSETRR
- This command marks the data set as being under maintenance, by setting a flag in the data set’s ICF catalog entry. (This flag is shown as ‘Recovery Required’ in a catalog listing (LISTCAT).)
- SHCDS FRUNBIND
- This command unbinds any retained locks held against the data set. The locks are no longer associated with any specific disk location or data set.
- SHCDS FRBIND
- This command re-binds to the new data set all retained locks that were unbound from the old data set. The locks are now associated with the named data set. The data set name used in FRBIND must match the name used in the earlier FRUNBIND.
- SHCDS FRRESETRR
- This frees the data set from being under maintenance, resetting the flag in the ICF catalog.
Based on the previous example of using REPRO to move a VSAM data set, the complete solution for a data set accessed in RLS mode, and which preserves the RLS locks, is as follows: