Rules for File Names
Rules for File Names
At compile time:
- If the file is program-described, the file does not need to exist.
- If the file is externally-described, the file must exist but you can use an IBM i system override command to associate the name to a file defined to the IBM i system, or you can use the EXTDESC keyword to indicate the file defined to the system.
- If the file name in the RPG program is longer than 10 characters, you must specify the EXTFILE keyword. If the file is externally-described, you must specify the EXTDESC keyword.
At run time:
- If you use the EXTFILE keyword, the EXTMBR keyword, or both, RPG will open the file named in these keywords.
- Otherwise, RPG will open the file whose name is the same as the name of the file in the RPG program. This file (or an overridden file) must exist when the file is opened.
- If an IBM i system override command has been used for the file that RPG opens, that override will take effect and the actual file opened will depend on the override. See the EXTFILE(filename | *EXTDESC) keyword for more information about how overrides interact with this keyword.
When files that are not defined by the USROPN keyword are opened at run time, they are opened in the reverse order to that specified in the file description specifications. The RPG IV device name defines the operations that can be processed on the associated file.