125
EXTRACT Directive
Read and Lock Data
Format
EXTRACT (chan[,fileopt])varlist
Where:
chan
Channel or logical file number of the file from which to read the data.
fileopt
BSY=stmtref Traps Error #0: Record/file busy
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.
Comma-separated list of variables, literals, and IOL= options.
varlist
Description
Use EXTRACT to read data from the file you specify as the channel. When ProvideX
reads the data, it is split into one or more fields (either separated by the current
delimiter or in an embedded IOList format) with the contents of the first field placed
into variable 1, the second field into variable 2, and so on.
ProvideX automatically converts numeric data when moving it into numeric
variables while processing the EXTRACT directive. Numeric data converted during
If you want a field to be skipped, use an asterisk * as a place holder for a variable name.
If you specify more variables than there are fields in the record, ProvideX will
initialize the additional variables to either zero (if a numeric variable) or a null string
(if a string variable). The EXTRACT 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.