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

given the following piece of code: CALL SUB-PGM USING A, B, C. CALL SUB-PGM USING A, C, C. (a) Both CALL statements will always produce same result. (d) Both CALL statements may produce different result. (c) Compile-time error because SUB-PGM is a dataname. (d) Compile-time error because A, B, C are used twice.

2 Answers   TCS,


What will happen if we generate GDG (+2) version without generating (+1) version?

2 Answers   IBM, T systems,


How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?

0 Answers  


have in 100 records in a flat file i want to move records like 1,3,5,7,9,11,.. to Output file1 and 2,4,6,8,10,12,14 .. records moved to Output file2..Pls Provide real time answer..

5 Answers   TCS,


The maximum number of dimensions that an array can have in COBOL-85 is ?

11 Answers  






What is the mode in which you will OPEN a file for writing?

4 Answers  


How to concatenation one or more string?

4 Answers   Temenos,


What do you understand by passing by reference and passing by content?

1 Answers  


in cobol main pgm is calling sub pgm but sub pgm does not exists , what abend i get if submit the job?

2 Answers   HSBC,


wht do u mean by (*,intrdr) wht is * used for ?

2 Answers  


What the difference is between continue and next sentence?

0 Answers  


What is the file organization clause ?

2 Answers  


Categories