File control

F

File-Control

it contains the information of the files used, their access mode, organization mode, record key, file status etc.

It contains the below clauses:

  • Select: used to identify the name of the file, where it is saved.
  • Assign: used to associate a file with external file i.e. Physical file
  • Access mode: used to specify how to access the file.
Three modes:
  • Sequential: used to access the files sequentially. This mode can be used for sequential, indexed and relative files.
  • Dynamic: used to access the files dynamically on the basis of record key and can be used for indexed and relative files.
  • Random: used to access the file randomly on the basis of record number and can be used for indexed and relative files.
  • Record key: key is used for indexed files only and it should be unique and does not allow duplicate values in index keys.
  • Organization: it gives the logical structure of the file. This clause is optional for sequential files as if we do not specify any organization, by default compiler will take it as sequential.
Three types:
  • Sequential: used to access the files sequentially.
  • Indexed: used to access the files on the basis of record key.
  • Relative: used to access the file on the basis of record number.
  • File status: it is used to get the information of failures and success status of input output operations performed on the files.it is used for all kind of files except sort files.

About the author

Add comment

By neelam

Find us

Address
Chennai ,Tamil Nadu,603103

Hours
Monday—Friday: 9:00AM–5:00PM
Saturday & Sunday: 11:00AM–3:00PM

About This Site

This site is to help the beginners in COBOL.

Categories