The UNLOCK statement removes file record locks.
UNLOCK file-name ALL {RECORD }
{RECORDS}
UNLOCK ALL RECORDS
UNLOCK THREAD
file-name is a relative or indexed file described in the Data Division.
A Format 3 UNLOCK THREAD statement removes the last lock applied to the thread. If the thread has only one lock (only one LOCK THREAD statement has executed in the thread), then the UNLOCK THREAD statement has the effect of allowing other threads to run. If more than one lock has been applied to the thread, then the UNLOCK THREAD statement removes the last lock applied to the thread and the thread remains locked until it has been unlocked as many time as it was locked. This allows a thread to lock itself, call a subroutine that also locks itself, and remain locked when that subroutine unlocks itself. See the entry in this section for LOCK THREAD.
If the current thread is not locked, the UNLOCK THREAD statement has no effect.