Record format description

When you describe a database file to the system, you describe the two major parts of the file: the record format and the access path. 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

In this example of specifications for record format ITMMST, there are three fields. Field ITEM is zoned decimal, five digits, with no decimal position. Field DESCRP is character, with 18 positions. Field PRICE is zoned decimal, five digits, with two decimal positions.

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 can 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 can describe a field FLDA as a packed decimal field of five digits and a logical file using FLDA might redefine it as a zoned decimal field of seven digits. In this case, when your program uses the logical file to read a record, the system automatically converts (unpack) FLDA to zoned decimal format.