Describing a database file to the system

When you describe a database file to the system, you describe the two major parts of that file: the record format and the access path.

Describing the record format of a database file

The record format describes the order of the fields in each record. The record format also describes each field in detail including: length, data type (for example, packed decimal or character), validity checks, text description, and other information.

The following example shows the relationship between the record format and the records in a physical file:
Specifications for Record Format

A physical file can have only one record format. The record format in a physical file describes the way the data is actually stored.

A logical file contains no data. Logical files are used to arrange data from one or more physical files into different formats and sequences. For example, a logical file could change the order of the fields in the physical file, or present to the program only some of the fields stored in the physical file.

A logical file record format can change the length and data type of fields stored in physical files. The system does the necessary conversion between the physical file field description and the logical file field description. For example, a physical file could describe FLDA as a packed decimal field of 5 digits and a logical file using FLDA might redefine it as a zoned decimal field of 7 digits. In this case, when your program used the logical file to read a record, the system would automatically convert (unpack) FLDA to zoned decimal format.

Describing the access path of a database file

An access path describes the order in which records are to be retrieved. When you describe an access path, you describe whether it will be a keyed sequence or arrival sequence access path. Access paths are discussed in more detail in Describing the access path for a database file.

Naming conventions used in a database file

The file name, record format name, and field name can be as long as 10 characters and must follow all system naming conventions, but you should keep in mind that some high-level languages have more restrictive naming conventions than the system does. For example, the RPG/400* language allows only 6-character names, while the system allows 10-character names. In some cases, you can temporarily change (rename) the system name to one that meets the high-level language restrictions. For more information about renaming database fields in programs, see your high-level language guide.

In addition, names must be unique as follows:


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]