Top
NetCOBOL V11.0 CBL Subroutines User's Guide
FUJITSU Software

2.8 CBL_WRITE_FILE

This routine writes data in a file.

Specification

Parameter data definition
01  file-handle               PIC X(4).
01  relative-address-in-file  PIC 9(18) BINARY.
01  byte-count                PIC 9(9) BINARY.
01  flag                      PIC 9(4) BINARY.
01  buffer                    PIC X(n).
01  status-code               PIC S9(4) COMP-5.
Calling format
CALL "CBL_WRITE_FILE"
    USING file-handle
          relative-address-in-file
          byte-count
          flag
          buffer
    RETURNING status-code.

Interface

file-handle

Specifies the file handle returned by CBL_OPEN_FILE or CBL_CREATE_FILE.

relative-address-in-file

Specifies the relative address of data in the file.

byte-count

Specifies the length of data to be written. The maximum value is 0xFFFF.

flag

Specifies flag information as follows:

  • 0: Standard writing

buffer

Specifies the area storing the data to be written.

Return code

The return code is set in the status-code specified in the RETURNING clause.

status-code
  • 0: Successful

  • -1: Parameter error

  • Other than above: Value indicating ANSI74 file status