12.6.25 RECL Specifier

The RECL specifier indicates the length of each record in a file connected for direct or keyed access, or the maximum length of a record in a file connected for sequential access.

The RECL specifier takes the following form:

RECL = rl

rl
Is a positive numeric expression indicating the length of records in the file. If necessary, the value is converted to integer data type before use.

If the file is connected for formatted data transfer, the value must be expressed in bytes (characters). Otherwise, the value is expressed in 4-byte units (longwords). If the file is connected for unformatted data transfer, the value can be expressed in bytes if compiler option /ASSUME=BYTERECL is specified.

The rl value is the length for record data only. It does not include space for control information, such as two segment control bytes (if present) or the bytes that RMS requires for maintaining record length and deleted record control information.

The length specified is interpreted depending on the type of records in the connected file, as follows:

Errors occur under the following conditions:

Table 12-2 lists the maximum values that can be specified for rl for disk files that use the fixed-length record format:

Table 12-2 Maximum Record Lengths (RECL) on OpenVMS Systems

  Record I/O Statement Format 
File Organization   Formatted (bytes)   Unformatted (longwords) 
Sequential  32767  8191 
Relative  32255  8063 
Indexed  32224  8056 

For other record formats and device types, the record size limit may be less, as described in the OpenVMS Record Management Services Reference Manual.

You must specify RECL when opening new files (STATUS='NEW', 'UNKNOWN', or 'SCRATCH') and one or more of the following conditions exists:

The default value depends on the setting of the RECORDTYPE specifier, as shown in Table 12-3:

Table 12-3 Default Record Lengths (RECL) on OpenVMS Systems

RECORDTYPE  RECL value 
'FIXED'   None; value must be explicitly specified 
All other types  133 bytes (for formatted records)
511 longwords (for unformatted records) 


Previous Page Next Page Table of Contents