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

3.15 cobfa_rewcurr()

Rewrite the current record after a sequentially read (sequential rewrite).

long  cobfa_rewcurr  (
  long  fd,                /* file descriptor         */
  const char  *recarea,    /* record area             */
  long  reclen             /* rewritten record length */
);

Description

The current record is rewritten with the contents of the record area <recarea> in the file indicated by the file descriptor <fd>. The rewritten record length <reclen> specified is valid only if the file is in the variable-length format. If the file is a record sequential file (FA_SEQFILE), the original record length cannot be changed.

Execution Conditions

File Organization

Sequential file

-

Record sequential file

Executable (*)

Relative file

Executable (*)

Indexed file

Executable (*)

Open Mode

INPUT mode

-

OUTPUT mode

-

I-O mode

Executable (*)

EXTEND mode

-

Access Mode

Sequential

Executable (*)

Random

-

Dynamic

-

* : The record must have been positioned by a sequential read.

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_EDUPL

22

Although the value of the primary record key or alternate record key of the record to be rewritten already exists in the file, duplication of the primary record key or alternate record key is not permitted

FA_EBADLENG

44

The specified value of the rewritten record length is out of the permissible range

* : See "3.2 cobfa_delcurr()" for additional values.