EXTRACT

PURPOSE:
To read and lock a record from a file.
STATEMENT SYNTAX:
{stno}EXTRACT{RECORD}(unit{,ERR=}{,END=}{,DOM=}
 {,IND=}{,KEY=}{,TBL=}){input var list}{IOL=}

EXAMPLE:
0100 EXTRACT(5,KEY=K$,ERR=9900)*,A$,B$,C$ 
0250 EXTRACT(U+1,KEY=K2$(1,5),DOM=0275)IOL=0080 
9876 EXTRACTRECORD (X,ERR=100)MY_RECORD$
NOTES:
Once the RECORD has been read by the EXTRACT statement, access to the record on other channels open by this( see LINUX NOTE) or other users is PREVENTED. (Any attempt to access an EXTRACTed record will result in the occurrence of an ERROR 0 after SM-32 has retried every 1/10th of a second for 10 seconds).
The record is unlocked when the user that issued the EXTRACT performs any other operation on the channel.
The NEXT RECORD POINTER is not advanced after the read operation.
Therefore a WRITE operation after an EXTRACT does not require a KEY= or IND= option.
In all other respects, the EXTRACT command is the same as the READ command.

LINUX NOTE: An EXTRACTed record is only locked from other users not from other channels of the locking user.
SEE:
read