Monday, 28 July 2014

COBOL File Operation.

A file is a collection of data related to a set of entities and typically exists on a magnetic tape or a disk. The data contained in a file is logically organised into an ordered set of data items and is known as a record. The individual data items in a record are called its fields. 

For example, a file may contain data related to the employees of Infosys. The data pertaining to any individual corresponds to a record. The fields may be employee number, employee name, employee’s mail-id, employee’s age, etc., The number of characters in any field is known as the field size and the cumulative size of all the fields in a record is known as the record size. 

It is important to note that there exists some restriction on record size. For example, the lower and upper limit for record size may be 2 bytes and 4096 bytes respectively.

All most all application use file for day to day processing. File's can be broadly divided into three category or may be more than three based as per application requirment. 

  • Transaction File : Used to store online transaction data which will be updated in Master File during night batch cycle.
  • Master File : Which is used to store actual data related to customer. 
  • Temporary File : Used for store data temporarily.

There are three basic types of file operations namely.

  • Create: Refers to producing a brand new file and writing one or more logical records into it.
  • Retrieve: Refers to reading the logical records from a file.
  • Update: Refers to maintenance of records in a file to ensure that it is up to date. There are three types of updating operations. They are Record deletion, Record insertion and Record modification.

Created with Artisteer

No comments:

Post a comment