EXTRACT {(channelno{options})}{inputlist}
EXTRACT RECORD{(channelno{options})}{strvar}


EXTRACT locks the record just read from other users. The record remains locked until another I/O operation is performed on that channel or until the channel is closed. See Locking Files (LOCK). EXTRACT does not advance the file pointer at the end of the statement as other verbs do.

The EXTRACT, FIND, and INPUT verbs use the same syntax as the READ and READ RECORD verbs. See the READ verb for additional information.

Note that only records that have data can be locked. EXTRACTing a record that has just a key and no data (records in Sort files and records in Direct and Mkeyed files that have a record length set to zero) will not cause the record to be locked. The structure of the key chain makes it possible to lock just one key, so locking must occur on the data portion of the record.


In BBj 6.0 and higher, immediately after throwing !ERROR=0 attempting to read a file, TCB(10) returns the byte offset that was locked in the file.  This value, when combined with the BBjOpenFileInfo::getExtracted() method, can be used to force-close the file that holds the lock.

If the EXTRACT verb is used, the file pointer is not moved.

See Also

Verbs - Alphabetical Listing