Sign in

docs RPG Reference

Positions 23-27 (Record Length)

Positions 23-27 (Record Length)

Free-Form SyntaxRecord-length parameter of the device-type keyword

This entry must be blank if the LIKEFILE keyword is specified. The Record Length of the parent file is used.

Use positions 23 through 27 to indicate the length of the logical records contained in a program-described file. The maximum record size that can be specified is 32766; however, record-size constraints of any device may override this value. This entry must be blank for externally described files.

If the file being defined is a record-address file and the record length specified is 3, it is assumed that each record in the file consists of a 3-byte binary field for the relative-record numbers starting at offset 0. If the record length is 4 or greater, each relative-record number in the record-address file is assumed to be a 4-byte field starting at offset 1. If the record length is left blank, the actual record length is retrieved at run time to determine how to handle the record-address file.

If the file opened at run time has a primary record length of 3, then 3-byte relative-record numbers (one per record) are assumed; otherwise, 4-byte relative-record numbers are assumed. This support can be used to allow ILE RPG programs to use System/36 environment SORT files as record-address files.

Table 1. Valid Combinations for a Record Address File containing Relative Record Numbers (RAFRRN)

Record Length Positions 23-27RAF Length Positions 29-33Type of Support
BlankBlankSupport determined at run time.
33System/36 support.
> = 44Native support.