# FIND Locate and Read Data

> Source: https://manual.pvxplus.com/directives/find

## Format

**FIND** (*filespec*\[,*fileopt*\])*varlist*

***Where:***

|  |  |
| --- | --- |
| *filespec* | Can be a numeric expression indicating the open channel number to use or a string expression containing the pathname or table name (if string is prefixed by the keyword **TABLE**) of the file to use. |
| *fileopt* | Supported file options (see **[File Options](https://manual.pvxplus.com/appendix/input-output-and-control-options#Mark1)**):<br>\|  \|  \|<br>\| --- \| --- \|<br>\| **BSY**=*stmtref* \| Traps Error #0: Record/file busy \|<br>\| **DIR**=*num* \| Direction indicator (Not supported with **\[WDX\]** tag) \|<br>\| **DOM**=*stmtref* \| Missing record transfer \|<br>\| **END**=*stmtref* \| End-of-File transfer \|<br>\| **ERR**=*stmtref* \| Error transfer \|<br>\| **IND**=*num* \| Record index \|<br>\| **KEY**=*string$/num* \| Record key \|<br>\| **KNO**=*num* \\| *name$* \| File access key number (*num*) or name (*name$*) \|<br>\| **REC**=*name$* \| Record prefix (REC=VIS(*string$***)** can also be used) \|<br>\| **RNO**=*num* \| Record number \|<br>\| **RTY**=*num* \| Number of retries (one-second intervals). This overrides the value defined by the **['WT'](https://manual.pvxplus.com/parameters/wt)** system parameter. \|<br>\| **SIZ**=*num* \| Number characters to read \|<br>\| **TBL**=*stmtref* \| Data translation table \|<br>\| **TIM**=*num* \| Maximum time-out value in integer seconds \|<br>\| *stmtref* \| Program line number or statement label to which to transfer control \| |
| *varlist* | Comma-separated list of variables, literals, or **IOL=** options. |

*(TABLE support was added in PxPlus 2018.)*

## Description

Use **FIND** to read data from the file (channel) you specify. When PxPlus reads the data, it is 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.

PxPlus automatically converts numeric data when executing a **FIND** statement and moving numerics into variables. Numeric data converted during a **FIND** directive does ***not*** use the **'DP'** (Decimal Point Symbol) or **'TH'** (Thousands Separator) system parameters for European decimal settings.

If you want to skip a field, use an **\*** (*asterisk*) as a placeholder for the variable name. If you include more variables in a **FIND** directive than there are fields in the record, PxPlus initializes the additional variables to either 0 (for a numeric variable) or a null string (for a string variable). The **FIND** directive 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

[EXTRACT Read and Lock Data](https://manual.pvxplus.com/directives/extract)  
[READ Read Data from File](https://manual.pvxplus.com/directives/read)

## Example

```
0410 find (1,err=1000,dom=1200)A,B,*,*,E$
```
