Resolving retained locks before opening data sets in non-RLS mode
VSAM sets an ‘RLS-in-use’ indicator in the ICF catalog cluster entry when a data set is successfully opened in RLS mode.
About this task
The procedure described here lists the steps you can take to switch from RLS to non-RLS mode in readiness for batch processing. The procedure is for a single data set, and should be repeated for each data set that is to be accessed from batch in non-RLS mode. CICS provides a suite of sample programs designed to help you to automate most of this procedure, which you can tailor to suit your own requirements (see The batch-enabling sample programs):
Procedure
- Prevent further use of the applications that access the data set, so that no more locks can be created. One way to do this is to disable transactions that use the data set; but you may have your own technique for quiescing applications.
- Check for any retained locks by using the INQUIRE DSNAME command on each CICS region that has been accessing the data set (see INQUIRE DSNAME). Generally there should not be any, and you can continue by quiescing the data set and running your batch program(s).
- If there are retained locks, the RLS-in-use indicator prevents the data set being opened in non-RLS mode. In this case, use the CAUSE and REASON options on the INQUIRE UOWDSNFAIL command to find out what has caused them. You can then take steps to resolve the retained locks, preserving data integrity or not, using the SET DSNAME command. Do this before you quiesce the data set, because in some instances the locks cannot be resolved while the data set is quiesced.
- Use the access method services SHCDS LIST subcommand to check whether there are any locks held by CICS regions on which you have not issued INQUIRE DSNAME; for example, because the system is not currently running. See z/OS DFSMS: Access Method Services for ICF.
- If, for some reason, there are retained locks that you cannot resolve, you can choose to use the SHCDS PERMITNONRLSUPDATE subcommand that allows the batch program to override the retained locks and force the open for the data set.
- When you are satisfied that there are no more retained locks, quiesce the data set and run your batch program(s).