PreviousProgrammer's Guide (9.1 revision 1) Next

Calculating the Logical Record Length

Show this topic in Library frames

You must supply the logical record length to the Create operation (14). The logical record length is the number of bytes of fixed-length data in the file. To obtain this value, calculate how many bytes of data you need to store in the fixed-length portion of each record.

For example, the following table shows how the data bytes in the example Employees file are added together to obtain a logical record length:

Field
Length (in Bytes)
Last Name
25
First Name
25
Middle Initial
1
Employee ID
4
Phone Number
13
Pay Rate
4
LOGICAL RECORD LENGTH
72

In calculating the logical record length, you do not count variable-length data, because variable-length information is stored apart from the fixed-length record in the file (on variable pages, not data pages).


Note
The maximum logical record length is (page size - 8 - record overhead) for 8.x files and (page size - 6 - record overhead) otherwise, except for files with a variable-record length. The maximum record length is practically unlimited for files with a variable-record length.

Chapter contents
Publication contents

Prev topic: Creating a Data File
Next topic: Choosing a Page Size