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

What are options have been removed in COBOL 11?

1 Answers  


What are the different data types in cobol?

0 Answers  


How can i write a comp-3 variable into a sequential file should i declara the field in the file description as comp- 3?

1 Answers  


Which is the best IBM mainframe Training Institute in Ameerpet, Hyderabad

35 Answers  


Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?

0 Answers  






COMP?

2 Answers  


how we rectify soc4 and soc7 error in project(need real time answer)? please reply

3 Answers   HCL, Wipro,


wht is the use of evalute verb ? how do u declare recfm in cobol and jcl ?

2 Answers   EDS,


can we use variable picture clause as xx.99 in cobol.

3 Answers  


What is the usage of comp fields in cobol?

0 Answers  


How did the release of cobol/370 version 1.3 improve the performance of release 1.1?

0 Answers  


What is COMP SYNC?

3 Answers  


Categories