INQUIRE DSNAME
You can use the INQUIRE DSNAME command to find out whether the data set has any retained locks or if it is waiting for lost locks recovery by any CICS® region.
INQUIRE DSNAME(…) RETLOCKS returns a value of RETAINED if the CICS region has any shunted units of work that have made uncommitted changes to the named data set, and NORETAINED if it does not. (RETLOCKS may return the value NORETAINED while changes are being made or units of work are being retried.) You can use this command to find out whether or not there are any retained locks that you need to resolve before running batch.
The INQUIRE DSNAME(…) LOSTLOCKS command returns:
- RECOVERLOCKS if the CICS region has lost locks recovery work to complete for the named data set. In this case, the RETLOCKS option returns RETAINED (except briefly while recovery work is being carried out, when RETLOCKS could be NORETAINED).
- REMLOSTLOCKS if the CICS region in which the command is issued does not have any lost locks recovery work to complete, but one or more other CICS regions in the sysplex do have. In this case the data set is still in a lost locks condition (but the RETLOCKS option in this CICS returns NORETAINED).
- NOLOSTLOCKS if the data set is not in a lost locks condition. This is the normal case. RETLOCKS could be either RETAINED or NORETAINED.