1 / 11

Week 14 Reading a File

Week 14 Reading a File. Loops. Files. File - collection of records. Logical records - represent entities (persons, places, objects, things, etc.). 1234567890123456 John Smith 12000 500.00. 1234654321098765 Richard Roe 12000 500.00. Fields - describe properties of the entities.

fancy
Download Presentation

Week 14 Reading a File

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Week 14Reading a File Loops

  2. Files File - collection of records Logical records - represent entities (persons, places, objects, things, etc.) 1234567890123456 John Smith 12000 500.00 1234654321098765 Richard Roe 12000 500.00 Fields - describe properties of the entities

  3. Basic Concepts DASD (direct access storage device) • Performance: • Seek time • Rotational delay • Transfer time Track Magnetic disks Cylinder (vertical alignment of tracks)

  4. Access Data Tracks  Rotational delay Seek time Locating the beginning sector Locating the right track  Transfer time: Transferring data from the disk to memory Read/write Head

  5. Basic Concepts DASD (direct access storage device) Tracks Physical records (blocks, pages) Block overhead Logical records

  6. File Organization and Access Methods Progression Magnetic tape • Heap (sequential) files • Hashed • Hashed files • Sorted* • Indexed sequential • B+ trees (e.g., VSAM files) Sequential access method Hash methods DSAD Secondary storage devices Indexed access methods *Applies to accessing records, not just storing them

  7. File Organization and Access Methods • File OrganizationThe physical arrangement of data in a file into records and pages on secondary storage • Types: • Heap (unordered)-sequential • Ordered (ordered by value) • Hash • Access methodThe steps involved in storing and retrieving records from a file

  8. Heap or Sequential Files Queue Records are accessed in the same sequence they were placed into the file (first in, first out).

  9.  Insert at the very top  Define variables  Define file stream  Open file For-nextLoop

  10. Copy-and-pastefrom For-next loop While loop End of file

More Related