The RELEASE statement explicitly releases record locks without updating the records using a WRITE or DELETE and it also clears all execution locks without issuing an UNLOCK.



RELEASE {{variable,} expression}



If variable is specified it should be a valid file descriptor variable (i.e. It should have been the subject of an OPEN statement).

If an expression is supplied it should evaluate to the record key of a record whose lock the program wishes to free. If variable was specified the record lock in the file described by it is released. If variable was not specified the record lock in the file described by the default file variable is released.

If RELEASE is issued without arguments then all record locks in all files, that were set by the current program, will be released. It also releases all execution locks that were set in the current program with the LOCK statement.



Where possible the program should avoid the use of RELEASE without arguments. This is less efficient and can be a dangerous - especially in subroutines.

For more detailed information on record locking, see the article The Keys to Record Locking.



READU Rec FROM File, "Record" ELSE ABORT 203, "Record"
IF Rec<1> = "X" THEN
    RELEASE File, "Record"