Previous Topic Next topic Print topic


Fixed-length and Variable-length Records

A file can contain:

Using variable-length records might enable you to save disk space. When you use fixed-length records, you need to make the record length equal to the length of the longest record. If your application generates many short records with occasional long ones, using fixed-length records wastes a lot of disk space, so variable-length records would be a better choice.

The type of record is determined as follows:

To use: Specify the clause:
Variable-length records RECORDING MODE IS V
Fixed-length records RECORDING MODE IS F

Otherwise:

To use: Specify the clause:
variable length records RECORD IS VARYING
fixed length records RECORD CONTAINS n CHARACTERS

Otherwise:

To use: Specify the Compiler directive:
variable length records RECMODE"V"
fixed length records RECMODE"F"

Otherwise, to use variable length records, specify the RECMODE"OSVS" Compiler directive plus one of the following:

Previous Topic Next topic Print topic