|Oracle® OLAP DML Reference
10g Release 1 (10.1)
Part Number B10339-02
A file unit number assigned to a file opened for reading in a previous call to the FILEOPEN function.
Before you can use the RECNO function, you must open the file for reading. When the file unit number is not associated with an open file or the file has been opened for writing, RECNO returns an error.
RECNO is usually used with FILEREAD or FILENEXT, which read whole records. When you are reading data from a file with the FILEGET function, which can read partial records, RECNO returns the number of times you have read data from the file, not the number of actual records.
See also the LINENUM option, which holds the current line number of output.
When the file is a text file, a record is delimited by a newline character. When the file is a binary file, you must set the file's LSIZE attribute to the record length with the FILESET command. TEXT is the default file type.
Example 20-5 Using RECNO with FILEREAD
In the following example code, the FILEREAD command maintains the integer dimension, adding each record number associated with
filename. The text associated with each record number becomes each value of the variable
DEFINE dim1 INTEGER DIMENSION DEFINE textvar TEXT <dim1> x = FILEOPEN('filename' R) FILEREAD x APPEND dim1 = RECNO(x) W 8 TEXTVAR