![]() |
VOOZH | about |
COBOL an acronym for Common Business Oriented Language is a computer programming language, which was designed for business use. In COBOL, file access modes are used to specify how to access data from various file organizations according to requirements. In COBOL, there are 3 types of file organization:
Different file access modes can be used to access the data within the file for each file organization scheme. The following are the various access modes provided by COBOL:
The below table shows the file organizations and the access modes of files:
| File organization | Order of records | Access mode |
|---|---|---|
| Sequential | Order in which they were inserted | Sequential Access |
| Indexed | Based on the value of the record key | Sequential, Random, Dynamic Access |
| Relative | Order of relative record number | Sequential, Random Dynamic Access |
The file's records can be accessed from top to bottom, or sequentially from the beginning of the file towards its end.
By providing the key value, records can be accessed randomly from any point in the file. Only Indexed and Relative files can be used in this mode.
The records can be accessed both randomly and sequentially; for instance, we can use one file definition to obtain some records by providing the key values and some records by providing the key values in sequential order.