Reviewed and updated August 2020
Function |
Description |
EOF |
EOF(X) returns end-of-file status for file channel X: -1 if no file is open on channel X; 0 if file is open but end-of-file has not been reached; 1 if end-of-file has been reached (after some form of INPUT statement on a sequential file). |
ERF |
ERF(X) returns error/status information about the last operation on an ISAM file (see table below for details). In the case of ISAM-A files, it simply returns the value of the fstatvar (status) variable associated with the file in the ISAM-A OPEN statement. As with the EOF(X) function, it returns -1 for channels that are not open. Note that -1 is also a valid ISAM-A status (ISAM_LT, key found less than specified key), but the usage context should usually make that distinction clear. |
LOOKUP |
LOOKUP (FSPEC$) Returns the size of the specified file in blocks (0 for non-existing, 0.5 for a file with zero bytes). Note that the returned block count for files which appear to be contiguous (are an even multiple of 512 bytes) will be negative, unless you set OPTIONS=ABSLOOKUP in miame.ini. If you don't have control over that option, you may want to use the ABS(X) function on the result in order to confusion with files that happen to be a multiple of 512 bytes with, e.g. ABS(LOOKUP(FSPEC$)). |
These return the current line number within the current page and the current page number#, respectively, for sequential output files. | |
.FSTAT |
.FSTAT(CHANNEL) returns the file status for the last ISAM-A operation on the specified channel; equivalent to reading the value of the fstatvar variable specified on the OPEN statement, but more flexible in that it can be used regardless of whether the fstat variable is in scope, or even exists. In the case of XOPEN, it is the only way to retrieve the status. For details about the relation between various ISAM-A file operations and the status codes, see the relevant ISAM-A statement topics. |
.RECNO |
.RECNO(CHANNEL) returns the current record number for the specified random, ISAM, or ISAM-A file channel; equivalent to reading the value of the recnovar variable specified on the OPEN statement, but more flexible in that it can be used regardless of whether the recnovar variable is in scope, or even exists. See XOPEN and SET'RECNO. |
.RECSIZ |
RECSIZ(CHANNEL) returns the record size for the specified open file channel based on the OPEN (or XOPEN) statement. If the channel does not specify an open RANDOM, ISAM or ISAMA file, a negative value is returned. |
ERF(X) Values for ISAM files
Function |
Description |
14 |
Illegal record number |
32 |
Illegal ISAM statement code |
33 |
(after ISAM 1) indicates the key was not found |
34 |
(after ISAM 3) duplicate key found during add key |
35 |
link structure smashed |
36 |
(after ISAM 3) index file full (and auto-expansion disabled; see OPTIONS=NOAUTOX. |
37 |
(after ISAM 5) data file full (and auto-expansion disabled). |
38 |
(after ISAM 2 or 7) already at end of index |
39 |
Illegal ISAM sequence (violates LOKSER rules; if program was not designed to work with LOKSER, you can turn LOKSER off with SET NOLOKSER or LOKSER=OFF in miame.ini) |