Can anybody give me example of subscript and index

Answers were Sorted based on User's Feedback



Can anybody give me example of subscript and index..

Answer / billyboyo

In IBM Cobol there are two methods of accessing elements in
a table (array). By subscript, which you explicitly define
in the Data Division or by index, which is implicitly
defined by the compiler.

01 subscript-for-table COMP PIC S9(4).

If you want the 20th item, set the above to 20 and use
field-looked-for (subscript-for-table).

An index is the displacement of an item from the start of a
table. For a subscript, the displacement, which is needed
to find the item, is calculated at run time (from the
subscript and the length of the data item(s)). So an index
is faster, but is generally considered more complex to use.
Some features, like SEARCH ALL, require the use of an INDEX.

Is This Answer Correct ?    4 Yes 1 No

Can anybody give me example of subscript and index..

Answer / arya

number of occurences are called subscript.............


number of dispositional position are called index...........

Is This Answer Correct ?    1 Yes 3 No

Can anybody give me example of subscript and index..

Answer / krishna

Subscript means occuresses, it can declared in WS-section
index means displacement,need not be declared

Is This Answer Correct ?    1 Yes 5 No

Can anybody give me example of subscript and index..

Answer / pandu

Subscript is sequential reading Index is direct reading of
perticular position of record

Is This Answer Correct ?    0 Yes 5 No

Can anybody give me example of subscript and index..

Answer / mahii

index is no of occurance we can find data exactly

subscript is displacement mainli its is used in arrays to
load the data

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More COBOL Interview Questions

sample code for read a 2nd record from last in flatfile how can do?

4 Answers   iNautix,


1) can we display the index?

3 Answers   ADP, IBM,


what happens of we dont give time stamp in precompilation process

2 Answers  


why do u need inspect verb?

3 Answers   Patni,


How to find How Many Lines in Sysin DD * Parameter Thru Cobol Coding? If any one knows the Answer Please Reply .....Thanks From Shree

3 Answers   Merrill Lynch,






77 a pic x(4) value '1234' -----> instead of this 'abcd' 77 b pic 9(4) value zeros. move a to b what is the answers for both cases? IS it possible? Give me elementary move rules briefly......

8 Answers  


If i got a job on mainframe technology, will i have a bright future?. Some people are discouraging me. Let me know, is it true? Please bring back me from the confusion.

2 Answers  


how many maximum no of variables can be declared in linkage section ?

2 Answers   HCL,


How to use the same cobol program in Batch and CICS onlines ? Please expalin with an example. Thanks in advance.

1 Answers  


I've one string with spaces ( I N D I A ). My question is I want remove the spaces & combine in to single string without space (INDIA).How we can write the cobol program & wich options we need to use. Please let me know.

10 Answers   Mascon,


How to use the same COBOL program in Batch and CICS on lines? explain with an example

0 Answers   IBM,


In an array processing what is the thing that can be done by using subscripts but not by using index

4 Answers   JPMorgan Chase,


Categories