Answer Posted / 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 |
Post New Answer View All Answers
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
What are the different rules for performing sort operation?
explain sorting techniques in cobol program?
How do get the result of your program directly on your pc?
What rules are followed by the search verb.
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
What are various search techniques in cobol? Explain.
Write a cobol program making use of the redefine clause.
how do you define single dimensional array and multidimensional array in your cobol?
example for sub strings ? and refernce modifications whit output pls
What is the difference between Global and External Variables?
Can a Search can be done on a table with or without Index?
What is amode(24)?
Differentiate between structured cobol programming and object-oriented cobol programming.
What kind of error is trapped by on size error option?