| Directives |
|
| Format | EXTRACT
(chan[,fileopt])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 an EXTRACT directive does not use the 'DP' Decimal Point Symbol or 'TH' Thousands Separator system parameters for European decimal settings. 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 advances the file position to the next record (or a record you can specify using the KEY= or IND= option). Use the KNO= option to change the current file access key. |
|||||||||||||||||||||||||||||||||
| *Note* | EXTRACT locks the record being read to prevent other users from using a FIND, FIND RECORD, READ, READ RECORD, EXTRACT RECORD or another EXTRACT to access it. This lock stays 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 | FIND
Locate and Read Data, READ Read Data from File, EXTRACT Read and Lock Data, READ RECORD Read Record from File KEY( ) Function. |
|||||||||||||||||||||||||||||||||