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

2.3 CBL_CREATE_FILE2

CBL_CREATE_FILE2 generates a new file.

The difference between the CBL_CREATE_FILE subroutine and this subroutine is that this subroutine can support a file name containing a space.

Specification

Parameter data definition
01 file-name      PIC X(n).
01 access-mode    PIC 9(4) BINARY.
01 exclusion-mode PIC 9(4) BINARY.
01 device         PIC 9(4) BINARY.
01 file-handle    PIC X(4).
01 status-code    PIC S9(4) COMP-5.
Calling format
CALL "CBL_CREATE_FILE2"
    USING file-name
        access-mode
        exclusion-mode
        device
        file-handle
    RETURNING status-code.

Interface

file-name

Specifies the name of the file to be generated. It must be terminated by a null character. The maximum size of the file name is 255.

access-mode

Specifies one of the following access modes:

  • 1: Read-only mode

  • 2: Write-only mode

  • 3: Read-write mode

exclusion-mode

Specifies one of the following exclusion modes:

  • 0: No reading or writing

  • 1: No writing

  • 2: No reading

  • 3: No restrictions

device

Indicates an area reserved for future expansion. 0 must be set in this area.

file-handle

Specifies the area to store the file handle.

Return code

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

status-code
  • 0: Successful

  • -1: Parameter error

  • Other values indicate an ANSI74 file status.

Note

If the file specified in CBL_CREATE_FILE2 already exists, it is overwritten.