Top
NetCOBOL V11.0 COBOL File Access RoutinesUser's Guide
FUJITSU Software

3.20 cobfa_strec()

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: *).

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".