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

3.4 cobfa_delrec()

Delete the record indicated by a relative record number (random delete).

long  cobfa_delrec  (
  long  fd,                /* file descriptor        */
  unsigned long  recnum    /* relative record number */
);

Description

In the file indicated by the file descriptor <fd>, the record indicated by a relative record number <recnum> is deleted.

Execution Conditions

File Organization

Sequential file

-

Record sequential file

-

Relative file

-

Indexed file

Executable

Open Mode

INPUT mode

-

OUTPUT mode

-

I-O mode

Executable

EXTEND mode

-

Access Mode

Sequential

-

Random

Executable

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

49

The specified file is opened in a mode other than I-O mode. Alternatively, an invalid file descriptor is specified.

FA_EBADACC

90

The file is opened with a file organization or access mode that does not allow this function to be executed.

FA_ELOCKED

99

The record specified by the value of the relative record key is locked

FA_ENOREC

23

The record specified by the relative record number does not exist

* : Typical status values are described above. For other values, see "Chapter 5 Error Number and I-O Status".