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

I have a Main Program which is calling Sub-Program which is a DB2 pgm. What will happen if I am not closing the cursor used in the Sub-program? Please advise..

3 Answers   iGate,


can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech

0 Answers  


how to code in cobol while using variable block file?

1 Answers  


What is the difference beetween Arrays and Tables in Cobol? please dont give the answer that arrays in cobol terminology is called tables......

3 Answers   BirlaSoft,


What are the rules of the move verb?

0 Answers  






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,


How do pass the values to the parameters in cobol

2 Answers  


How can you get the ksds file records into your cobol program?

0 Answers  


Explain about Redefines cluse?

3 Answers   iGate,


What are some examples of command terminators?

1 Answers  


Can we use icetool in cobol program?

3 Answers  


I have a sequential file of 100 records. How do I load the records into a two dimensional array ?

3 Answers   IBM, Xansa,


Categories