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:

  1. Create a new data set
  2. Copy (REPRO) the data from the old data set to the new
  3. Delete the old data set
  4. 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:

Procedure

  1. Quiesce the data set that is being moved, to prevent access by CICS regions while maintenance is in progress.
  2. Create a new data set into which the data is to be copied.
    At this stage, it cannot have the same name as the old data set. For example:
     DEFINE CLUSTER (NAME(CICS.DATASET.B) …
  3. Issue the access method services (AMS) SHCDS FRSETRR subcommand to mark the old data set as being under maintenance.
    For example:
     SHCDS FRSETRR(CICS.DATASET.A)
    This makes the data set unavailable while the move from old to new is in progress, and also allows the following unbind operation to succeed.
  4. Issue the SHCDS FRUNBIND subcommand to unbind any retained locks against the old data set.
    For example:
     SHCDS FRUNBIND(CICS.DATASET.A)
    This enables SMSVSAM to preserve the locks ready for rebinding later to the new data set.
    You can include the SHCDS FRSETRR and FRUNBIND subcommands of steps 3 and 4 in the same IDCAMS execution, but they must be in the correct sequence. For example, the SYSIN input to IDCAMS would look like this:
    //SYSIN   DD *
     SHCDS FRSETRR(old_dsname)
     SHCDS FRUNBIND(old_dsname)
    /*
  5. After the unbind, use REPRO to copy the data from the old data set to the new data set created in step 1.
    For example:
     REPRO INDATASET(CICS.DATASET.A) OUTDATASET(CICS.DATASET.B)
  6. Use the SHCDS FRSETRR subcommand to mark the new data set as being under maintenance.
    This is necessary to allow the later (step 8) rebind operation to succeed. For example:
     SHCDS FRSETRR(CICS.DATASET.B)
  7. Delete the old data set to enable you to rename the new data set to the name of the old data set.
    For example:
     DELETE CICS.DATASET.A
  8. Use access method services to rename the new data set to the name of the old data set.
    For example:
     ALTER CICS.DATASET.B NEWNAME(CICS.DATASET.A)
    You must give the new data set the name of the old data set to enable the following bind operation to succeed.
  9. Use the SHCDS FRBIND subcommand to rebind to the recovered data set all the retained locks that were unbound from the old data set.
    For example:
     SHCDS FRBIND(CICS.DATASET.A)
  10. Use the SHCDS FRRESETRR subcommand after the rebind to reset the maintenance flag and enable the data set for use.
    For example:
     SHCDS FRRESETRR(CICS.DATASET.A)
    You can include the SHCDS FRBIND and FRRESETRR subcommands of steps 8 and 9 in one IDCAMS execution, but they must be in the correct sequence. For example, the SYSIN input to IDCAMS would look like this:
    //SYSIN   DD *
     SHCDS FRBIND(datasetname)
     SHCDS FRRESETRR(datasetname)
    /*