what is the difference between occurs and occurs depending
on? i dont think so there is the difference in
storage..then why we should use occurs depending on?
Answer Posted / steve dipaula
Okay folks, I know it has been a while since this was posted
but here is the answer. (1) The memory allocation is the
same whether or not the depending on clause is used period!
(2) The reason for making it a variable length table is for
sorting purposes. More specifically Binary Searches! For a
large table it will have to split the halves more time that
if you have a smaller table. So when loading the table you
keep count of the number of entries at the end of that
process you can set the depending on variable to that value.
Then when the search is executed it will see the table size
as the exact amount of entries, not the full number of
allocated slots.
Example:
Table is defined to have 100 occurrences. And you load 35
items in the table. If you do a search-all (binary search)
it may have to be tested 7 time before finding the item you
are looking for.
Same scenario 100 occurrences, 35 items loaded. But the
depending on variable is set to 35. It might only have to
search 6 times. I know the difference is negligible but in
a much larger case the difference would be quite significant.
| Is This Answer Correct ? | 19 Yes | 1 No |
Post New Answer View All Answers
How to remove 2 duplicate records and copy only one using job control language?
Describe the cobol database components?
What is a scope terminator give example?
what are decleratives in cobol?
Write a program to explain size error.
if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.
In COBOL, what is the different between index and subscript?
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
What is rmode(24)
what is the difference between COBOL2 AND COBOL390?
What are the different rules for performing sort operation?
what is the use of outrecord?
What are the different data types in cobol?
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need