Chapter 11. LOGICAL FILES
CHAPTER OBJECTIVES
Upon completion of this chapter, you should be able to
Explain the purpose of logical files.
Explain the differences between physical files and logical files.
Explain how logical files are defined.
Describe the various forms of logical files that can be used to define access paths to data stored in physical files.
Demonstrate the use of logical files in application programs.
LOGICAL FILES
There will be times when a user needs to access a physical file in some manner other than the way the physical file is defined. For example, a user may want to access employee records using either a Social Security number or a name as the key field. Similarly, a user may wish to group employees and print or display them by department number or city. An accounts receivable clerk may wish to access only those accounts that exceed a certain balance. In another situation, a user may wish to select or omit specific records from a physical file or even select or omit fields within the records. A logical file can be used to accomplish all of these tasks.
A logical file defines an access path to data stored in one or more physical files. Logical files do not contain any data themselves but provide a view of data from physical files. The logical view allows a user to decide what data are to be retrieved from the physical file or files and the format in which they are to appear.
Logical files may be used to
Sequence data in a physical file in a different order.
Select or ...
Get PROGRAMMING IN COBOL/400: 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.