For each data set record in the BCDS, DFSMShsm performs the following processing:
If the version is not a retired version, DFSMShsm continues processing.
For each data set that does not have a retired version and does not indicate that all backup versions are for an uncataloged data set and that does not have a scratch date recorded by prior EXPIREBV processing, DFSMShsm determines the names of the storage class, management class, and data class for the data set.
If a catalog entry exists for the data set, the data set has not been scratched.
If the data set is not cataloged and the MCB record does not contain a scratch date, DFSMShsm assumes that the data set has been scratched, and it records the current date in the scratch date field of the MCB record in the BCDS. DFSMShsm resets an existing scratch date to the current date if the date of the most recent backup version is the same or later than the existing scratch date. Because DFSMShsm cannot be sure, it assumes that the old scratch date is invalid. This is because the data set may have been recreated and backed up after prior EXPIREBV processing found that the data set had been scratched. This creates the possibility that more then one EXPIREBV command will need to be run to remove the backup versions, but it also prevents DFSMShsm from deleting valid backup versions. The scratch date is stored when either DISPLAY or EXECUTE is specified on the EXPIREBV command.
DFSMShsm then checks the MCB record to determine if the data set was SMS-managed when it was last backed up. If the data set was SMS-managed when it was backed up, DFSMShsm processes all of its cataloged backup versions as described here. If it was not SMS-managed, DFSMShsm processes it as described in Processing for expired backup versions of non-SMS-managed data sets.
If any error occurs, other than being unable to find the data set, DFSMShsm assumes that the data set still exists and processes only the uncataloged versions of the data set as described in Processing for expired backup versions of non-SMS-managed data sets.
If the MCB record already contains a scratch date, DFSMShsm assumes that the data set has been scratched and determines from the MCB if the data set was SMS-managed when it was last backed up.
Each SMS-managed data set’s backup versions are processed based on the RETAINDAYS value and the attributes specified in the management class associated with the data set (or in the default management class if the data set is not associated with a management class). If a management class name is found but there is no definition for the management class, DFSMShsm issues a message and does not process the cataloged backup versions of that data set.
After the management class has been established, processing depends on whether the data set exists:
The second-newest version is treated as if it had been created on the same day as the newest backup version. Therefore, the second-newest version (newest EXTRA backup copy) is not expired until the number of retention days specified by the RETAINDAYS value or the number of days specified in RETAIN DAYS EXTRA BACKUPS attribute in the management class have passed since the creation of the newest backup version. (The management class value is only used if RETAINDAYS was not specified for the version).
If only one backup version exists for the data set, it is not deleted by the EXPIREBV.
If this is the first time EXPIREBV has found this data set to be deleted:
The second-newest version is treated as if it had been created on the same day as the newest backup version. Therefore, the second-newest version (newest EXTRA backup copy) will not be expired until the retention days specified by the RETAINDAYS value or the number of days specified in RETAIN DAYS EXTRA BACKUPS attribute have passed since the creation of the newest backup version. (The management class value is only used if RETAINDAYS was not specified for the version).
If the scratch date has been set by prior EXPIREBV processing:
The second-newest version is treated as if it had been created on the same day as the newest backup version. Therefore, the second-newest version (newest EXTRA backup copy) will not be expired until the retention days specified by the RETAINDAYS value or the number of days specified in RETAIN DAYS EXTRA BACKUPS attribute have passed since the creation of the newest backup version. (The management class value is used only if RETAINDAYS was not specified for the version).
If all active copies have been deleted and there are one or more retained copies, then the most recent retained copy will be moved from the MCBR record to the MCB record so that the MCB record has at least one valid backup version.
If you specified the DISPLAY parameter for EXPIREBV, DFSMShsm updates the MCB record only if the scratch date field has been changed (updates only that field in the record).
If the DISPLAY parameter was specified in the EXPIREBV command, DFSMShsm creates an output line for every backup version that is eligible to be deleted. The expired retained backup versions are appended to the end of active backup versions. The difference in the output data set between the active backup versions and the retained backup version is that the generation number of retained backup version is displayed as "***" rather than generation number.
If DFSMShsm is running in DEBUG mode when the EXPIREBV command is initiated, the output created is identical to the output when DFSMShsm is not in DEBUG mode, but no backup versions are deleted even if EXECUTE is specified.