Defining Externally Described Files

You can use DDS to describe files to the IBM i system. Each record type in the file is identified by a unique record-format name.

An E entry in position 22 of the file description specifications identifies an externally described file. The E entry indicates to the compiler that it is to retrieve the external description of the file from the system when the program is compiled.

The information in this external description includes:

The information the compiler retrieves from the external description is printed on the compiler listing as long as OPTION(*EXPDDS) is specified on either the CRTRPGMOD or CRTBNDRPG command when compiling the source member. (The default for both of these commands is OPTION(*EXPDDS).)

If your file is defined with the QUALIFIED keyword, the format names are specified in the program in the form filename.formatname except when you are specifying the format names in the keywords used to define the file. For example, assume a file is named MYFILE in your program, and it has formats FMT1, FMT2 and FMT3. To rename FMT3 to NEWFMT3, you specify RENAME(FMT3:NEWFMT3); to ignore FMT2, you specify IGNORE(FMT2). Within your calculations, or when specifying the LIKEREC keyword, you use the qualified form of the names, MYFILE.FMT1 and MYFILE.NEWFMT3.

The following section describes how to use a file description specification to rename or ignore record formats and how to use input and output specifications to modify external descriptions. Remember that input and output specifications for global externally described files are optional, and that they are not allowed for externally described files in subprocedures or for qualified files.



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