What is Alternate Index ? How is it different from regular
index ?

Answers were Sorted based on User's Feedback



What is Alternate Index ? How is it different from regular index ?..

Answer / vish

The answer provided by NK is absolutely correct but we
should be very careful whil choosing the alternate index as
it may not be Unique. e.g. in the example given by NK, the
Emp# will always be Unique within a company but many many
employees can have the same name. So if we declare Emp_name
as AIX (i.e. alternate Index) and then use it for fetching
data then we may end up in multiple rows and hence we may
need additonal logic to arrive at the desired unique record.

Your comments are Welcome!!

Is This Answer Correct ?    14 Yes 0 No

What is Alternate Index ? How is it different from regular index ?..

Answer / nk

The purpose of any index is to provide the most efficient
access to the records in a file. Say you have a file of
employee names and numbers. Usually the primary index will
be the employee number. If you request a record by
providing the empl#, the access will be very fast. If you
have to very often request a record by the empl name, you
may want to create a second (a/k/a alternate) index based
on the name. So when you provide a name, the access to the
correct record also will be very fast.

Is This Answer Correct ?    10 Yes 2 No

Post New Answer

More COBOL Interview Questions

What are subroutines ? and how do we pass data to the sub routines?

2 Answers   Xansa,


What will happen if a variable is declared as below.. Explain with an example? Working storage section:- 01 WS-VARX PIC X(10) VALUE 'ABCDEFGHIJ'. 01 WS-VARN REDEFINES WS-VARX PIC 9(5) VALUE '12345'. What will happen I am going to Display the WS-VARX and WS- VARN?

6 Answers   Xansa,


how to move the records from file to array table. give with code example

0 Answers   ADP, Syntel,


01 xxx pic 9(4). 01 yyy pic 9(6). move 123456 into yyy. move yyy to xxx. display yyy. what would be the value of yyy

13 Answers   HSBC,


Write the code implementing the perform … varying.

0 Answers  


How do get the result of your program directly on your pc?

0 Answers   UST,


Name some of the examples of COBOl 11?

0 Answers   CSC,


How do u initialize an array?

2 Answers   CTS,


I need to compare two VSAM files, both having 'number' as key. If there is a matching record, write the data into another VSAM file. How will it be possible.

1 Answers   DSRC,


can i use multiple when statements in search & search all ? justify ur answer?

2 Answers  


What is mean by maxcc

7 Answers   Syntel,


i have a file which contains records like 10,30,90,50,20,40,80,60,70 i want to display these records in reverse order like 70,60,80,40,20,50,90,30,10 please give me the cobol code (do not sort the records)

3 Answers   Cap Gemini, Mind Tree,


Categories