Record

Record can be defined as a collection of fields. One or more fields together form a Record. The Records may be of fixed or variable length. For example , Employee ID , Name , Grade and Salary together form one record.

  • Physical Record – The collection of information that exists on the external device is called Physical Record or Block. During input or output operations , this information is handled by the system as a unit.
  • Logical Record – Physical Records are not handled by the COBOL program directly. Instead , it processes Logical Records. Logical Records are nothing but sequences of pieces of information that a COBOL program can process. Logical Records can correspond to complete Physical Records or only to a part of the Physical Record. Also it can correspond to a part or all of one or more Physical Records. The COBOL programs can handle only one particular record at any point of time.

File Handling in COBOL

File Handling is an important feature in COBOL Language. Only structured data in the form of files are handled. Files consist of Records and Fields, which contain information.

Similar Reads

Field

A field can be defined as a collection of information that is required to be given a structure. Each field stores data about an element. A single element represents a particular field. For example, each of the elements –  Employee ID, Name, Grade, and Salary represents a particular field....

Record

Record can be defined as a collection of fields. One or more fields together form a Record. The Records may be of fixed or variable length. For example , Employee ID , Name , Grade and Salary together form one record....

Files and Types of Files

Files are logical representation of large volumes of data in the form of database objects that are stored in a structured way permanently in a memory location. The maximum number files that can be used in a COBOL Program are 255 files. There are three types of files in COBOL :...

Sample COBOL Code for Declaration of a File

Let us take an Employee Dataset as an example. The dataset is as follows :...

Sample COBOL Code for Processing of a File

...

Contact Us