how can we code index in an array of cobol pgm?



how can we code index in an array of cobol pgm?..

Answer / jenny

It can be done in two ways:

1.Using the INDEXED BY phrase on the OCCURS clause.

2.index can be defined(as a working storage variable) with
USAGE IS INDEX clause.

In either case the index is set, icreased or decreased
using the SET verb in the Procedure Division.

Is This Answer Correct ?    15 Yes 2 No

Post New Answer

More COBOL Interview Questions

what is S04E error in jcl?

11 Answers   IBM, L&T,


I have a Flat file in which certain records are present in a tabular format. I need to extract some of the records on some basis from it and copy them into a flat file...how it can be done ??

2 Answers   HCL,


What is the maximum length of a field you can define using COMP-3 in COBOL?

1 Answers   UGC Corporation,


I have a files containing both duplicate and non-duplicate records.The file is already sorted by a key.I want to determine those records that are duplicate and records that are non-duplicate.If duplicate the record is move to a duplicate file and if non-duplicate that will be move to valid file.thank you

1 Answers  


What is Static and Dynamic linking ?

3 Answers  


what is scope terminator

2 Answers   IBM,


What is the difference between Call and a Link?

0 Answers  


How to Write the RESTART Logic Using COBOL?

4 Answers   GalaxE, L&T, Syntel, TCS,


I have a File that has duplicate records. I need only those records that occur more than thrice.?

3 Answers   IBM, Wipro,


can we read in input the file with a variable length ? please , how ..could you help me ?

3 Answers   EDS,


in a indexed file what is procedure for read the records from 12 to 18. please give the code example

2 Answers   L&T,


What are VS COBOL 11 special features?

1 Answers  


Categories