CBL_CREATE_FILE

Creates a new file and leaves it open for byte-stream operations.

Syntax:
call "CBL_CREATE_FILE" using filename
                             access-mode
                             deny-mode
                             device
                             file-handle
Parameters:
Using call prototype (see Library Routines - Key) Picture (32-bit systems)
filename pic x(n). pic x(n).
access-mode cblt-x1-compx pic x comp-x.
deny-mode cblt-x1-compx pic x comp-x.
device cblt-x1-compx pic x comp-x.
file-handle cblt-bytestream-handle pic x(4) comp-5.
On Entry:
filename
Space- or null-terminated filename of the file to be opened. You can use embedded environment variables and library names in filename. For more information see the chapter Filenames in your File Handling book.
access-mode Defines access mode:
1 Read only
2 Write only (deny-mode must be 0)
3 Read/write
64 Read/write files greater than 4Gb
deny-mode Defines deny mode:
0 Deny both read and write (exclusive)
1 Deny write
2 Deny read
3 Deny neither read nor write
device Reserved for future use (must be 0).
On Exit:
file-handle Returns a file handle for a successful open.
Comments:

The success of the call can be checked by examining the RETURN-CODE special register. For more information, see the section Special Registers in the chapter Concepts of the COBOL Language in your COBOL Language Reference.

You can use embedded environment variables and library names in filename.

See Also: