This chapter explains the File Access functions, calling parameters and returned values. Using this application programming interface (API) allows applications to access the features of the COBOL file system.
The File Access API consists of the following functional categories:
Category | Function | Description | Access |
---|---|---|---|
File Oriented | Close a file | - | |
Get the file attributes or key structure of an indexed file | - | ||
Open a file | - | ||
Open a file | - | ||
Get the length of the current record | - | ||
Get the relative record number of the positioned record | - | ||
Release all record locks | - | ||
Set an exclusive lock | - | ||
Release an exclusive lock | - | ||
File Positioning | Position to the record indicated by the value of an arbitrary key | SD | |
Position to the record indicated by the relative record number | SD | ||
Record Oriented | Delete the current record after a sequential read | S | |
Delete the record indicated by the value of the primary record key | RD | ||
Delete the record indicated by a relative record number | RD | ||
Reads the record indicated by the value of an arbitrary key | RD | ||
Reads a record sequentially | S | ||
Read the record indicated by the relative record number | RD | ||
Rewrite the current record after a sequential read | SD | ||
Rewrite the record indicated by the value of the primary key | RD | ||
Rewrite the record indicated by a relative record number | RD | ||
Write a record indicated by the value of the primary record key | RD | ||
Write a record sequentially | S | ||
Write the record indicated by the relative record number | RD | ||
Status Oriented | Get the last error number | - | |
Get the last I-O status | - |
RD: function that is usable when the open mode is random access or dynamic access
SD: function that is usable when the open mode is sequential access or dynamic access
S: function that is usable only when the open mode is sequential access