1 / 10

Mid Range Concepts

Mid Range Concepts. Chapter 11 Logical Files. Defining Keys. File Access: Direct Access : the storage device can go directly to the location and read the information stored there. Primary Key: Field whose value is unique for each record.

cosmo
Télécharger la présentation

Mid Range Concepts

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. Mid Range Concepts Chapter 11 Logical Files

  2. Defining Keys • File Access: • Direct Access: the storage device can go directly to the location and read the information stored there. • Primary Key: Field whose value is unique for each record. • Sequential Access: storage device must go through all storage locations that physically precede the storage location being sought. • Relative Record Number: Each record is given a number based on it relative position within the file.

  3. Defining Keys • Key Fields: DDS provides the ability to define key fields. • KSAP (Keyed sequence access path): Provides the programmer the ability to access the records in both arrival sequence and keyed sequence. • Key Fields can be Primary or Secondary • Primary: unique • Secondary: not unique

  4. Defining Keys • Primary Keys: • Place the word UNIQUE prior to any file references in DDS. • AFTER record specifications reenter the field name of the key with a K in position 17. • Secondary Keys: • Same as above but DO NOT specify unique.

  5. Logical Files • Logical Files: usually created to satisfy different user access requirements. • They offer a different view of the data than supplied by the physical file. • They do not contain any data. • They are based on a physical file and cannot exist independently. • Utilize DDS to define the record layout.

  6. Logical Files • Record level keyword PFILE is required to specify the physical file they are based on. • Would you want to perform updates to logical files? • Be careful when not all the fields of the physical file are present.

  7. Logical Files • Can add or delete records of a physical file and the logical file will automatically see the adjustments. • Cannot delete an entire physical file if logical files exist using it. • Command: DSPDBR (Display Database relations) will display all dependent files for a specified file.

  8. Logical files • Logical files are much easier to change than physical files. • Can use the command FNDSTRPDM to find all programs that use the logical file because they will need to be recompiled.

  9. Logical Files • Joining logical file: Can contain information from multiple physical files. • Up to 32 files can be joined in a logical file. • JFILE keyword is used to specify file names. • JOIN keyword is used to specify files joined. • JFLD keyword is used to specify fields used to join the files.

  10. Logical Files

More Related