The RECL specifier indicates the length of each record in a file connected for direct access, or the maximum length of a record in a file connected for sequential access.
The RECL specifier takes the following form:
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. (For the correct form of this option, see your user manual or programmer's guide.)
Except for segmented records, the rl is the length for record data only, it does not include space for control information.
The length specified is interpreted depending on the type of records in the connected file, as follows:
You can use the RECL specifier in an INQUIRE statement to get the record length before opening the file (see Section 13.5.26).
If you read a fixed-length file with a record length different from the one used to create the file, indeterminate results can occur.
The maximum length for rl depends on the record type and the setting of the CARRIAGECONTROL specifier, as shown in Table 13-2.
Table 13-2 Maximum Record Lengths (RECL) on Tru64 UNIX, Linux, and Windows Systems
|Record Type||CARRIAGECONTROL||Formatted (size in bytes)|
|Fixed-length||'NONE'||2147483647 (2**31-1) 1|
|Stream_LF||'LIST'||2147483647 (2**31-1) 2|
1 Subtract 1 if the compiler option specifying OpenVMS
defaults is used.
2 U*X only
The default value depends on the setting of the RECORDTYPE specifier, as shown in Table 13-3.
Table 13-3 Default Record Lengths (RECL) on Tru64 UNIX, Linux, and Windows Systems
|'FIXED'||None; value must be explicitly specified.|
|All other settings||132 bytes for formatted records; 510 longwords for unformatted records.|