Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Can a Search can be done on a table with or without Index?

1289


How you can read the file from bottom?

1158


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

1349


Which division and paragraphs are mandatory for a COBOL program?

1278


what is s000 u4087 error? please give the all error codes in cobol,jcl.

17881


What is the difference between perform … with test after and perform … with test before?

1459


How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that

3234


What is the difference between goback, stop run and exit program in cobol?

1592


What guidelines should be followed to write a structured cobol prgm?

1148


What are the cobol coding sheets?

1276


How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?

1145


What is the LINKAGE SECTION used in COBOL?

1530


how do you reference the ksds vsam file formats from cobol programs

1193


What is the local-storage section?

1148


What is redefines clause in COBOL?

1295