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
TO WRITE A QUADRATIC EQN ROOTS ARE COMPLEX IN COBOL PROGRAM

Program for Sequential File Creation & Rewriting  We have to write a program to create a Length file with just two fields: l (Length) and l-c (Length-Code). Add a few records.

NEGATED SIMPLE CONDITION: Any of the easy condition explained can be preceded by the logical operator NOT. The consequence of placing the operator NOT before an easy condition

Example of add verb: (a) ADD A TO B. This illustration represents that the value of A will be added to the value of B and the result will be stored in B.  The alignment of

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

SPECIAL-NAMES: This paragraph is used to associate some hardware names to the user-specified mnemonic names. This paragraph is elective in all compilers. The format of this pa

Object-Computer - Configuration section: The computer name specifies a specific computer on which the object program is to be executed. The MEMORY SIZE is used to show the

PROGRAM TO DEMONSTRATE SORT VERB: The file for which a record having 2 fields, viz., Account Number and Name is already available. Sort the file based on the ascending order o

Environment Division: The Environment Division is the second division in the COBOL source program. It is mainly machine-dependent . The computer and all the peripheral dev

PERFORM STATEMENT:   The PERFORM statement can be used to execute the group of consecutive statements written elsewhere in the program. We refer to this group of statements a