Determine the ending point for the BCDS scan

The ending point for the scan of the BCDS depends on:

If ENDKEY is specified in the command, DFSMShsm ends when the next record to be processed has a higher key value than that specified with ENDKEY.

If neither ENDKEY nor RESUME is specified in the command or if RESUME is specified without ENDKEY and the saved ending key is blank, DFSMShsm ends EXPIREBV processing after the last BCDS record is processed.

If the saved planned ending key is not blank and RESUME is specified without ENDKEY in the command, DFSMShsm ends EXPIREBV when the next record to be processed has a higher value than the saved planned ending key.