Tuesday, 12 August 2014

COBOL File Description Entries for a Sequential File.

There are two types of entries that are required in a program for any file. They are file description entries and record description entries. 
The file description entries specify the physical aspects of the data such as t he size relationship between physical and logical records, the size and name(s) of the logical record(s), labeling information, etc., These entries are made in the ENVIRONMENT DIVISION. 
The record description entries describe the logical records in the file, including the category and format of data within each field of the logical record, different values the data might be assigned, etc,. These entries are made in the DATA DIVISION.
The file description entries are made in the FILE-CONTROL paragraph of the ENVIRONMENT DIVISION using the SELECT . . . ASSIGN . . . clause. Its format is given below.

Format :

Corresponding to every file there must be a SELECT . . . ASSIGN . . . clause. The purpose of this is to establish a relationship between the logical file name (internal to COBOL) used in the program and the physical file name (external file name) used to store the file on DASD. 
After the relationship between physical and logical records has been established, only logical records are made available to the programmer. For this reason, when we say record, we mean the logical record and not the physical record.
Example : File Description for Sequential File.

No comments:

Post a comment