Logically Sparse Files

A logically sparse file is a file that contains sparse records. For files with fixed-length records, you can write a record with a position number more than one greater than the number of the last record. For example, if the last record in the file, DOG DATA, has a position number of 55, you can write a record with a position number of 60. Records 56, 57, 58, and 59 are called sparse records.

Note: Only files with fixed-length records can contain sparse records.

Sparse records are not written to a file. However, if you open a file that contains sparse records, you can write to a record that was previously sparse. For example, you could write a record to position number 57 in the file, DOG DATA.

If you try to read a sparse record, it will be retrieved as all X'00' bytes. In fact, reading a sparse record will appear the same as reading a record that was actually written with X'00'.