130
FIND Directive
Locate and Read Data
Format
FIND (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 of 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
stmtref
Program line number or label to transfer control to.
Description
Use FIND to read data from the file (channel) you specify. When ProvideX reads the
data, it's split into one or more fields (either separated by the current delimiter or
defined by an embedded format with headers, etc.). The contents of the first field are
placed in variable 1, the second field in variable 2, and so on.
ProvideX automatically converts numeric data when executing a FIND statement and
moving numerics into variables. Numeric data converted during a FIND directive does
parameters for European decimal settings.
If you want to skip a field, use an asterisk * as a place holder for the variable name. If
you include more variables in a FIND directive than there are fields in the record,
ProvideX initializes the additional variables to either zero (for a numeric variable) or
a null string (for a string variable). If successful, FIND advances the file position to
the next record (or the record you specify if you use a KEY= or IND= option). Use
the KNO= option to change the current file access key.
Note: If the record is not found when reading using a KEY= or IND= option, the
current file position is not changed (unlike READ).
See Also
Examples
0410 FIND (1,ERR=1000,DOM=1200)A,B,*,*,E$