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
Example of Sign condition: The illustration below describes the use of the sign condition. Illustration:     77  BALANCE  PIC  S9 (6) V99.       .       .     I

OCCURS CLAUSE - PROGRAM: We have to write a program to demonstrate the occurs clause. Get names of the students and show them on the screen.  identification division.

SEQUENTIAL FILE CREATION AND REWRITING: We have to write a program to create a student file with just two fields: sno i.e. Student Number and same i.e. Student Name. Add a few

calculate simple interest

calculate simple interest

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

REWRITE STATEMENT: As in the situation of a relative file, the REWRITE statement needs that the file should be opened in the I-O mode, and if the SEQENTIAL access mode is spec

ARITHMETIC VERBS: Most of the problems need some computations to be performed on the input or intermediate data that are numeric in nature. The Arithmetic verbs are used to pe

WRITE statement: The WRITE statement for tape and sequential-disk files has the syntax shown below. WRITE            record-name      [  FROM    identifier   ] As a resu

When using the accept verb in cobol is it possible to assign something other then "SYSIN" for a ddname?