Wednesday, April 22, 2009

Chaining

File organization requires that relationships be established among data items. It must show how characters from fields, fields form files, and files relate to one another. Establishing relationships is done through chaining or the use of pointers. The file is a indexed-sequential access file sequenced by key 1 that reports part numbers. A record is retrieved by part number. To retrieve all the fenders sold, we can scan the file and determine the total. However, a better way is to chain the records by linking a pointer to each.
      The pointer gives the address of the next part type of the same class. In the case of fenders, the first fender has a pointer that indicates 092, the address (part number) of the next fender in the second table. Fender 092, in turn, has a pointer that indicates 172, the address of the third fender in the fourth table. Fender 172 has a pointer that indicates END, signaling the last fender available. The search method applies similarly to other parts in the file. A graphic method of linking or,chaining records is shown by the connecting lines in the figure.

No comments:

Post a Comment