RPG/400 Help
- 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.
For program-described files, the file name entered in positions 7 through
14 must also be entered on:
- Input specifications if the file is a primary, secondary, or full
procedural file
- Output specifications or an output calculation operation line if the file
is an output, update, or combined file, or if the file is an input file and
records are also being added to the file
- Extension specifications if the file is a table, array, or record address
file, or a file processed by a record-address file
- Calculation specifications if the file name is required for the operation
code specified
- Line counter specifications if the device is a printer and default values
are to be overridden.
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:
- Input and output specifications for externally described files are
optional. They are required only if you are adding RPG/400 functions,
such as control fields or record identifying indicators, to the external
description retrieved.
- When an external description is retrieved, the record definition can be
referred to by its record format name on the input, output, or calculation
specifications.
- A record format name must be a unique symbolic name.
- A logical file with two record formats of the same name cannot have the
duplicate format names renamed and cannot be externally described.
However, such a file can be accessed if it is program described.
[ Top of Page | Previous Page | Next Page | Table of Contents ]
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.