The UNLOCK statement frees a record in a relative or sequential file that was locked by a previous READ statement.
The UNLOCK statement takes one of the following forms:
If no record is locked, the UNLOCK statement has no effect.
Examples
The following statement frees any record previously read and locked in the file connected to I/O unit 4:
UNLOCK 4
Consider the following statement:
UNLOCK (UNIT=9, IOSTAT=IOS, ERR=10)
This statement frees any record previously read and locked in the file connected to unit 9. If an error occurs, control is transferred to the statement labeled 10, and a positive integer is stored in variable IOS.
For More Information: