127
EXTRACT RECORD Directive
Read-Lock Data Record
Format
EXTRACT RECORD (chan[,fileopt])var$
Where:
chan
Channel or logical file number of the file from which to read the data.
fileopt
DOM=stmtref Missing record transfer
END=stmtref End-Of-File transfer
ERR=stmtref Error transfer
IND=num Record index
KEY=string$ Record key
KNO=num | name$ File access key number (num) or name (name$)
REC=name$ Record prefix (REC=VIS(string$) can also be used)
RNO=num Record number
RTY=num Number of retries (one second intervals)
SIZ=num Number characters to read
TBL=stmtref Data translation table
TIM=num Maximum time-out value in integer seconds.
var$
String variable. Receives the contents of the record being read.
Description
Use the EXTRACT RECORD directive to read a record from the file you specify
(channel). ProvideX will return the record's complete data portion in the string
variable you specify.
Apply the EXTRACT RECORD statement when dealing with native-mode operating
system files, when exchanging data with non-ProvideX applications, or when you
want to read a complete record (including data field separators). This directive will
access the record where the file pointer is pointing, or it will take the record specified
using the KEY= or IND= options. The file pointer remains on the extracted record
after it is read.
Use the KNO= option to change the current file access key.
Note: This directive locks the record being read to prevent other users from using a
FIND, FIND RECORD, READ, READ RECORD, EXTRACT RECORD or another EXTRACT
RECORD to access it. This lock remains active until the next I/O request for the same
file or until the file is closed. Using a KEY= option or READ, FIND or EXTRACT statement
to retrieve the next record while a record is locked will result in the locked record being
returned instead. You can enable read access for records that have been extracted by setting
the 'XI' parameter.
See Also