Procedure division statements for the indexed files, COBOL Programming

PROCEDURE DIVISION statements for the indexed files:

All the statements which are available for a relative file are also available for an indexed file.

READ STTATEMENT :

When either the RANDOM or DYNAMIC access mode is specified or the records are to be read in a random manner, the syntax is as shown below:

READ  file-name RECORD  [  INTO  IDENTIFIER  ]

           [  ; KEY   IS data-name ]

           [  ; INVALID  KEY  imperative-statement  ]

The data name in the KEY IS phrase should be either the prime key or the alternative key item. If the phrase is not specified, then the prime key is supposed. Let consider PERSONNEL be an indexed file and let EMP-NO be the prime key and NAME be the alternative key. 

 

Posted Date: 10/17/2012 8:40:52 AM | Location : United States







Related Discussions:- Procedure division statements for the indexed files, Assignment Help, Ask Question on Procedure division statements for the indexed files, Get Answer, Expert's Help, Procedure division statements for the indexed files Discussions

Write discussion on Procedure division statements for the indexed 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:

IF STATEMENT: The easiest form of the IF statement is  IF condition-1 statement-1 where the condition-1 may be any one from the shown below. When the condition-1

REDEFINES CLAUSE: At times it may be found that two or more storage regions defined in the DATA DIVISION are not in use concurrently. In such situations only one storage regio

OPEN statement: We know that the processing of a file should start with the execution of an OPEN statement. The file can be opened in any one of the 4 open modes - INPUT, OUTP

Example of Class condition: Let the BASIC-PAY be a data name in the card record defined with picture 9(5) V99. By reading the card we can test the value of the BASIC-PAY to ma

READ STATEMENT: The aim of this verb is to make available the next logical record from the input file. It is important to note the meaning of the "next" logical record in the

Point Location: The position of the decimal point is the other characteristic which can be specified in the case of the numeric data items. If the position is not specified, t

Illustration of nested if statement: Consider the nested sentence which is as shown below: The IF-ELSE pairs in this sentence can be detected by applying the rule whic

GIVING    file-name-5. The input files to be merged through the MERGE statements which are specified in the USING phrase. These files should be sequential files and should be

PROGRAM FOR ADD CORRESPONDING: We have to write a simple program to demonstrate Add Corresponding.   identification division.   program- id.   environment division.