Accessing Files Programmer's Guide (32650-90885)

Chapter 2 57
Creating A File
Specifying a Record Format
record is accompanied by an indication of its length. When you build a file containing
variable-length records, specify a record size at least large enough to accommodate your
longest record.
Figure 2-3. depicts a file with variable-length records. The byte count preceding the first
byte of each record gives its record's length.
Figure 2-3. Variable-length Records
Undefined-length records
When your file contains undefined-length records, the file system does not know the
amount of good data in any given logical record. The data length is "undefined."
Undefined-length records are especially useful when you are reading tapes of unknown
record length produced on other systems.
The file system knows the maximum room available in each record because the same
amount of space is allocated for each record; however, the data in the records may vary in
length, so MPE/iX pads the unused space with "filler" instead of good data. The file system
supplies this filler during writes to the file when the length of the data being written is less
than the maximum record length. The file system cannot distinguish between valid data
and filler. When you read data from a file you must be able to distinguish between the valid