bdfd1m0lDatabase Administration

Mapping the Aircraft File

Each LREC in the aircraft file contains the fields shown in Table 28. Table 28 also shows the number of bytes in each field.

Table 28. LREC Fields for the Aircraft File

Field No. of bytes
size 2
key 1
aircraft type 4
seat range 8
seat class 1
Total 16

Each LREC in the aircraft file therefore contains 16 bytes.

Because the database must be able to accommodate 50 aircraft types and three classes, you can calculate the required amounts of data as follows:

no. of aircraft types x no. of classes x LREC size = amount of data

The calculation is:

50 x 3 x 16 = 2400 bytes

This comparatively small number of bytes fits comfortably into a fixed block of size L4 (4095 bytes, including header and trailer). Because only one block is required, you can use a miscellaneous file.

Distributing the Aircraft LRECs

The aircraft file contains only one block of data. Because of this, all the data can be held in a single subfile, and you do not need to distribute the aircraft LRECs over many subfiles. Because you are using a single subfile, use the single-subfile algorithm (#TPFDB04) to distribute the LRECs in the file.

Note:
The flight file (see Figure 14) contains a pointer to the aircraft file. However, because the aircraft file contains only 1 block, the aircraft file address always locates the correct block. Because of this, you can remove the pointer from the flight file.

Allowing for Expansion

Although the aircraft file is small at the moment, it may well need to expand in the future. Therefore, consider now how a data overflow might be accommodated.

Because the aircraft LRECs are only 16 bytes long, there is already some room for expansion in the existing L4 (4095 bytes) block. Overflow blocks of L2 size (1055 bytes) should be adequate for future needs.

File Structure

When deciding the structure of the LRECs, consider how the TPFDF product will interrogate the file. The aircraft file is not an index file, so the LRECs do not need to contain pointers. The TPFDF product needs only the aircraft type, so the aircraft LREC structure can be as follows: