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
ADD VERB: The ADD Verb can be used to find the sum of two or more numbers and to store the sum.  The ADD verb takes any one of the two forms as shown below:

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

Illustration of Perform with varying option: A) Perform para-3 varying the k from 1 by 1 until k > 10. Here para-3 will be constantly executed 10 times (For k=1,2,3, .....1

Illustration of perform statement: PERFORM    CALCUALTE-TAX. In this illustration, the CALCULATE-TAX is either a section name or paragraph name. Assume that it is a section

Illustration of indexed tables: Index items defined through the INDEXED phrase of the OCCURS clause are one type of indexes. There can be other type of index items that are de

Literals: The actual values can too appear in a program. These values are termed as literals. For illustration, the statement MOVE 0 TO TOTAL indicates that the value zero wil

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

Abbreviation: The Consecutive relational conditions in a compound condition can be abbreviated in many cases as shown: (i) When the subjects in the consecutive relational c

PERFORM WITH UNTIL OPTION: The format is as shown below: Illustration:  A) Perform p-3 until i > 5. Here p-3 will be executed whenever i B)  Perform p-2 thru

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