Page 113 - Accounting Information Systems
P. 113

84      PART I        Overview of Accounting Information Systems


                            TAB L E
                               2-2    TYPICAL FILE PROCESSING OPERATIONS


                                      1. Retrieve a record from the file based on its primary key value.
                                      2. Insert a record into a file.
                                      3. Update a record in the file.
                                      4. Read a complete file of records.
                                      5. Find the next record in a file.
                                      6. Scan a file for records with common secondary keys.
                                      7. Delete a record from a file.



                         structures have two fundamental components: organization and access method. Organization refers to the
                         way records are physically arranged on the secondary storage device (for example, a disk). This may be
                         either sequential or random. The records in sequential files are stored in contiguous locations that occupy
                         a specified area of disk space. Records in random files are stored without regard for their physical relation-
                         ship to other records of the same file. In fact, random files may have records distributed throughout a disk.
                         The access method is the technique used to locate records and to navigate through the database or file.
                              No single structure is best for all processing tasks, and selecting a structure involves a trade-off
                         between desirable features. The file operation requirements that influence the selection of the data struc-
                         ture are listed in Table 2-2.
                              In the following section, we examine several data structures that are used in flat-file systems. Recall
                         from Chapter 1 that the flat-file model describes an environment in which individual data files are not
                         integrated with other files. End users in this environment own their data files rather than share them with
                         other users. Data processing is thus performed by stand-alone applications rather than integrated systems.
                         The flat-file approach is a single-view model that characterizes legacy systems in which data files are
                         structured, formatted, and arranged to suit the specific needs of the owner or primary user of the system.
                         Such structuring, however, may omit or corrupt data attributes that are essential to other users, thus pre-
                         venting successful integration of systems across the organization.


                         SEQUENTIAL STRUCTURE
                         Figure 2-37 illustrates the sequential structure, which is typically called the sequential access
                         method. Under this arrangement, for example, the record with key value 1875 is placed in the physical
                         storage space immediately following the record with key value 1874. Thus, all records in the file lie
                         in contiguous storage spaces in a specified sequence (ascending or descending) arranged by their
                         primary key.
                              Sequential files are simple and easy to process. The application starts at the beginning of the file
                         and processes each record in sequence. Of the file processing operations in Table 2-2, this approach is ef-
                         ficient for Operations 4 and 5, which are, respectively, reading an entire file and finding the next record
                         in the file. Also, when a large portion of the file (perhaps 20 percent or more) is to be processed in one
                         operation, the sequential structure is efficient for record updating (Operation 3 in Table 2-2). Sequential
                         files are not efficient when the user is interested in locating only one or a few records on a file. A simple
                         analogy can be made with an audiocassette. If you want to listen to only the tenth song on the tape, you
                         must fast-forward to the point at which you think the song is located and then press the play button. Some
                         searching is usually required to find the beginning of the song. However, if you are interested in hearing
                         all the songs on the tape, you can simply play it from the beginning. An example of a sequential file
                         application is payroll processing, whereby 100 percent of the employee records on the payroll file are
                         processed each payroll period. Magnetic tape is a cheap, effective, and commonly used storage medium
                         for sequential files. Sequential files may also be stored on magnetic disks.
                              The sequential access method does not permit accessing a record directly. Applications that require
                         direct access operations need a different data structure. The techniques described next address this need.
   108   109   110   111   112   113   114   115   116   117   118