IBM i5/iSeries Primer(c) Concepts and Techniques for Programmers, Administrators, and Sys[... ]ators

Logical files are objects of type *FILE you can create over one or more physical files to access records differently from the way they are stored in the physical files. Although this is usually called a different view of the file, the system creates a different access path through the records. Logical files don't contain any data. Each "record" in a logical file is nothing but a pointer to the actual record in the physical file.

Logical files are divided into two major categories: simple and join.

Creating a Simple Logical File

Simple logical files can be created over one or more physical files, which can have entirely different record structures and might have no fields in common at all. Unless you choose to omit records, a simple logical file accesses all the records in all the physical files it references.

To create a logical file, you must first write DDS specifications and compile them using the Create Logical File (CRTLF) command. The CRTLF command contains two parameters that cause confusion:

Adding and Removing Members

After creation, you can add members to a logical file using the Add Logical File Member (ADDLFM) command or remove members using the Remove Member (RMVM) command.

The ADDLFM command contains the same pair of MBR and DTAMBRS parameters, and they mean the same as they do for the CRTLF command.

Using Simple Logical Files

Simple logical files have many uses:

To the application program, a logical file looks just like a physical file. You code the file description and operations exactly as you would for a physical file.

Категории