DDS for physical and logical files


PFILE (Physical File) keyword--logical files only

Use this record-level keyword to identify the physical file(s) containing the data to be accessed through the record format you are now defining.

The format of the keyword is:

PFILE([library-name/]physical-file-name [.32])

The PFILE keyword is required on every record format in a simple or multiple format logical file. This keyword is similar to the JFILE keyword except it identifies this file as a simple or multiple format logical file; the PFILE keyword is not allowed with the JFILE keyword. Up to 32 physical file names can be specified on PFILE keywords in a logical file. If the maximum is being used, 32 physical file names can be specified on one record format (using one PFILE keyword) or 32 physical file names can be distributed among 32 record formats; or, file names can be unevenly distributed among record formats. In any case, the maximum number of physical file names allowed is 32. For restrictions on specifying multiple physical files when creating a logical file, see the appropriate high-level language manual.

For each physical-file-name, a library-name is optional. If the library-name is omitted, the library list (*LIBL) that is in effect at file creation time is used.

If you specify more than one physical file name for one record format in a multiple format logical file, all fields in the record format for the logical file must exist in all physical files specified. This type of file cannot be externally described in RPG because it results in duplicate format names. If your program requires access to fields that occur in one or more of the physical files specified on the PFILE keyword, but not in all of them, you can do one of the following:

Distributed Data Management (DDM) files are allowed on the PFILE keyword only when the logical file is being created on a remote system.

Examples:

The following examples show how to specify the PFILE keyword.

Example 1:

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R LOGRCD1                   PFILE(PF1)
     A

In this example, LOGRCD1 can use fields only in PF1.

Example 2:

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R LOGRCD2                   PFILE(PF1 PF2)
     A               :
     A               :
00020A          R LOGRCD3                   PFILE(PF1 PF2 PF3)
     A               :
     A               :
     A

In this example, LOGRCD2 must use fields common to PF1, and PF2, and LOGRCD3 must use fields common to PF1, PF2, and PF3.

Example 3:

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R LOGRCD4                   PFILE(PF1)
     A               :
     A               :
00020A          R LOGRCD5                   PFILE(PF2)
     A               :
     A               :
00030A          R LOGRCD6                   PFILE(LIB1/PF6)
     A

In this example, LOGRCD4, LOGRCD5, and LOGRCD6 can have unique fields. LOGRCD6 specifies a qualified physical-file name.


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