Ordered And Unordered Records; Maintaining Diskette Files - IBM 5110 User Manual

Apl
Table of Contents

Advertisement

150
Ordered and Unordered Records
The records in a direct access file can be ordered or unordered. An
ordered file means that the records are arranged in order according to
some major control field or by frequency of use. An unordered file
means that the records are not in any particular order.
With a 5110, it takes less time to specify and read 100 records at one
time than to specify and read individual records 100 times. Therefore,
arranging your records in order of frequency of use might save you
processing time. For example, a wholesale distributor organizes the
file of inventory items by frequency of use. Thus, the most active
items are at the beginning of the file. Then, when the file is used to
write customer orders, most of the records are located in a small area
of the file and can be processed as multiple records. In this example,
the total time to process the orders is less than if the records were
scattered throughout the entire file.
Maintaining Diskette Files
Once a file is created, file maintenance is often necessary. File
maintenance means performing those activities that keep a file current
for daily processing needs. Some file maintenance activities are:
,~dding,
deleting, and updating records. Adding means putting a
record in a file after the file is created. Deleting means identifying a
record so it will not be processed with other records. Updating means
adding or changing some data in a record.
Adding Records
Records can be added at the end of a file after a file has been
created. Thus, the file is extended by the added records.
Sometimes, however, the new records must be merged between the
records already in the file. This might be necessary to keep the file in
a particular order when the control fields of the new records are not
higher in sequence than those already in the file; for example, when
you are using the file for search by key operations. To put the new
records in the proper sequence, you must use an APL user-defined
'function to sort the file and create a new file containing the added
records or use the Diskette Sort feature if installed. See the IBM 5110
Customer Support Functions Reference Manual, SA21-·9311, for more
information on the Diskette Sort feature.

Advertisement

Table of Contents
loading

Table of Contents