Relative files, COBOL Programming

RELATIVE FILES:

The Files that are stored on a direct access storage medium like magnetic disk are frequently known as direct access files. The COBOL supports three different groups for disk files- sequential, relative & the index sequential.

A relative file is a magnetic-disk file organized in such a way that each record is identified by the relative record number. The relative record number identifies the position of the record from the starting of the file. Therefore the relative record number 1identifies the initial record, the relative record number 2 identifies the second record and so on.

A relative file can be access either successively or randomly. When the file is accessed successively the records are available in the increasing order of their relative record numbers. Whenever a file is accessed randomly, the programmer should specify the relative record number.

It may be noted that in the situation of relative organization, the reading and writing can be completed randomly. And hence, when a file is created by writing the record randomly, some of the record position may remain blank. While these positions can be filled in sub successively, the programmer must avoid specifying these empty positions while reading like relative file randomly. When a relative file is read in a sequential manner, then these empty places within it, if any, are ignored.

The handling of relative files needs some special codes in the FILE-CONTROL paragraph as well as in the PRCEDURE DIVISION.

 

Posted Date: 10/17/2012 8:09:15 AM | Location : United States







Related Discussions:- Relative files, Assignment Help, Ask Question on Relative files, Get Answer, Expert's Help, Relative files Discussions

Write discussion on Relative files
Your posts are moderated
Related Questions
PROGRAM FOR INDEXED SEQUENTIAL FILE CREATION: We have to write a program to create an Indexed Sequential File in a dynamic mode for Student particulars. Suppose just 3 fields:


ON SIZE ERROR OPTION:   If after an arithmetic expression, the result exceeds the highest value which can be accommodated in the result; this error is termed as size error. T

INPUT AND OUTPUT PROCEDURE IN SORT STATEMENT: The common format of the SORT statement can write as shown below: The format of the RELEASE statement is as shown be

COMPUTE VERB: The COMPUTE verb is very powerful. All the evaluations performed by the other 4 verbs can also be completed easily by using the COMPUTE verb. Its normal format i

Example of Special-names: Consider the illustration: Let the SPECIAL-NAMES paragraph be as shown: SPECIAL-NAMES. CHANNEL 1 IS PAGE-TOP. The Channel is related with the t

Group Item as Operand in the Relational Condition: Whenever an operand of a relational condition is the group item, the item is then considered to be an alphanumeric field. Th

single program how may when statement has used

SIMPLE MERGE VERB: Like sorting, the merging of files is often required in different commercial application. It is likely to merge two or more files with the help of one MERGE

CR and DB (Credit and Debit Sign): The two characters that is CR or DB symbol may appear only at the rightmost place of the picture. They are similar to the minus sign edit ch