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
How to remove 2 duplicate records and copy only one using job control language?
What are the pertinent COBOL commands?
What is the difference between binary search and sequential search?
What is the difference between PIC 9.99 and 9v99 in COBOL?
What is the difference between next sentence and continue in cobol programing language?
what are decleratives in cobol?
how do you reference the fixed unblock file formats from cobol programs
Write the code to count the sum of n natural numbers.
Which Search verb is equivalent to PERFORM…VARYING?
How do u write test cases?
I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
What is the difference between a binary search and a sequential search what are the pertinent cobol?
how to access the file from prodution from changeman tool and to submit a file to production
In COBOL programming, what is PERFORM? What is VARYING?