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
bal majduri ik kanuni apradh hai is de bavjud bache ,ghra,hotla,road, kam karn lai majbur han bacheya te mapeya nu parhai val prerit karn lai ik bashan teyar kro

PROGRAM USING OCCURS CLAUSE: We have to write a simple program to demonstrate Occurs Clause. Get the employee details for 3 persons and compute the total salary. identifica

DATA RECORD CLAUSE: The DATA RECORD clause, documents the record names defined for the file. For illustration, DATA RECORDS ARE REC-1, REC-2, REC-3 that means there are 3diffe

Rules for apply for the condition name: The rules below apply for the condition name. (i) The Condition names should be explained at level 88. The level number starts in ma

FD Entry for variable-length Records: The RECORDS CONTAINS and BLOCK CONTAINS clause are quite dissimilar in the case of files with variable- length records. The syntax of the

CLASS CONDITION:   The class condition establishes whether or not the value of the operand is numeric or alphabetic. The operand is numeric if it contains only the digits 0 t

Introduction to MOVE Verb: The aim of this section is to introduce the learner how to move data from one place to the other place in the memory. This is completed with the help

Common form of the READ statements: Format 1 is the common form of the READ statements. Format 2 is used when the access mode is either random or dynamic. For illustration,

FILE STATUS clause: This clause has been involved in the above syntax for completeness. The ORGANIZATION, REVERSE, ACCESS and STATUS clause can be specified in any order.

CONDITION - COBOL Programming: The condition is an entity which at one point of time can have only one of the two values - true or false. As we already know that, the IF verb