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
Name the sections present in data division.
what is the use of outrecord?
2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic
What is the difference between PIC 9.99 and PIC9v99?
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
What is inspect in cobol ?
Can we redefine the field of x(200) to less than 200?
What is length is cobol?
how to refer the data field?
Write a program to enter and display the names of students in a class using the occurs clause.
what is search and searchall?what is the diffrence between them?give an best example?
how to convert the recors form vsam file to db2 table tru file aid
i want a program using by if, evaluate , string, unstring, perform, occurs?
How you can characterize tables in cobol?
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.