RPG/400 Help

Positions 7-14 (File Name)

Entry
Explanation

A valid file name
Every file used in a program must have a unique name. The file name can be from 1 to 8 characters long, and must begin in position 7.

Each file used in the program is identified by a unique symbolic name in positions 7 through 14.

The file name specified in positions 7 through 14 must be an existing file name that has been defined to the OS/400 system, or one of the OS/400 system override commands must be used to associate the RPG/400 file name to the file name defined to the OS/400 system. For an externally-described file, the file must exist at both compilation time and at run time. For a program-described file, the file need exist only at run time. The file name specified in these positions, rather than the device name specified in positions 40 through 46, is used to point to the file. When the files are opened at run time, they are opened in the reverse order to that specified in the file-description specifications. The RPG/400 device name defines the functions that can be processed on the associated file.

You can specify file names in positions 7 through 14 that correspond to predefined device-file definitions supplied by IBM.

Program Described File

For program-described files, the file name entered in positions 7 through 14 must also be entered on:

Externally Described File

For externally described files, the file name entered in positions 7 through 14 is the name used to locate the record descriptions for the file. The following rules apply to externally described files:


[ Top of Page | Previous Page | Next Page | Table of Contents ]