Position to the record indicated by a relative record number.
long cobfa_strec ( long fd, /* file descriptor */ long stflgs, /* positioning attribute */ unsigned long recnum /* relative record number */ );
Description
In the file indicated by the file descriptor <fd>, positions to the record relating to the value of the relative record number <recnum>.
The positioning attribute <stflgs> includes the following category. If omitted, default values are assigned (default: *).
Positioning mode (COBOL syntax)
* | FA_EQUAL | Record equivalent to <recnum> (START KEY IS = ) |
FA_GREAT | Record greater than <recnum> (START KEY IS > ) | |
FA_GTEQ | Record equivalent to or greater than <recnum> (START KEY IS >= ) | |
FA_LESS | Record smaller than <recnum> (START KEY IS < ) | |
FA_LTEQ | Record equivalent to or smaller than <recnum> (START KEY IS <= ) |
Execution Conditions
File Organization | Sequential file | - |
Record sequential file | - | |
Relative file | Executable | |
Indexed file | - | |
Open Mode | INPUT mode | Executable |
OUTPUT mode | - | |
I-O mode | Executable | |
EXTEND mode | - | |
Access Mode | Sequential | Executable |
Random | - | |
Dynamic | Executable |
Return Values
0: Successful | Function executed successfully |
-1: Failed | Function failed. To get extended error information, call the cobfa_errno or cobfa_stat functions |
Generated Status
Return value of cobfa_errno () | Return value of cobfa_stat () | ||
---|---|---|---|
Successful | FA_ENOERR | 0 | Function executed successfully |
Failure (not all) (*) | FA_ENOTOPEN | 47 | The specified file is opened in a mode other than INPUT mode and I-O mode. Alternatively, an invalid file descriptor is specified |
FA_EBADACC | 90 | The file is opened with the file organization or access mode that does not allow this function to be executed | |
FA_EBADFLAG | 90 | A positioning mode not allowing execution of this function is specified. Alternatively, another flag specification is incorrect | |
FA_ENOREC | 23 | The record corresponding to the specified condition does not exist. |
* : Typical status values are described above. For other values, see "Chapter 5 Error Number and I-O Status".