| Directives |
|
| Format | READ
(chan[,fileopt])varlist
|
|||||||||||||||||||||||||||||||||||||
| Description | Use
the READ directive to read data from the
file you identify by channel. When it's read, the data will be split into one or more fields, either separated by the currently defined separator character or defined by embedded formats, with the contents of the first field placed in variable 1, the second field in variable 2, etc. ProvideX will convert numeric data automatically on a READ statement when moving it to numeric variables. Numeric data converted during a READ 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 in the record, use an asterisk '*' as a place holder instead of a variable name. You can refer to an IOList instead of using a list of variables in varlist. To do this, use IOL=iolref. The iolref can be a line number or statement label for the line containing an IOList, or it can be a string containing a compiled IOList. If you do not include variables in the READ directive, ProvideX will use the IOL= option (if you included one) in the OPEN statement for the given file. If varlist contains more variables than there are current fields in the record, then ProvideX initializes the additional variables to either zero (for numeric variables) or a null string (for string variables). The READ directive will advance the file position to the next record (or, if you use a KEY= or IND= option, to the record you identify then) and if you use the KNO= option, the current access key will be changed accordingly. ProvideX supports use of the READ directive with *MEMORY*. Automatic Padding with KEY=Option When you use KEY=string$:string$[:string$][...] ProvideX automatically pads key segments. This is valid only if you have Keyed files with segmented key definitions. ProvideX right-pads the key segment using $00$ (nulls) to the segment's full length. The last segment in a compound key will not be padded.
is the same as
|
|||||||||||||||||||||||||||||||||||||
| Read next Physical | If
you specify KNO=* on the READ directive, the system will
read and return the next physical record from the file.
The read will NOT utilize any of the key tables in order
to access the data. This significantly reduces the
overhead involved in the data retrieval process. Use of the Read Next Physical capability can greatly reduce the time it takes to process a file where the order of the data is not important.
|
|||||||||||||||||||||||||||||||||||||
| See Also | FIND
Locate and Read Data, EXTRACT Read and Lock Data, OPEN Open a File for Processing, *MEMORY* Create & Use Memory File |
|||||||||||||||||||||||||||||||||||||
| Examples | 0410 READ (1,ERR=1000,DOM=1200)A,B,*,*,E$ | |||||||||||||||||||||||||||||||||||||