JFILE (Joined Files) keyword—join logical files only

You can use this record-level keyword to identify the physical files that contain the data to be accessed through the join logical file you are defining.

The format of the keyword is:
JFILE([library-name/]physical-file-name [..256])

This keyword is similar to the PFILE keyword except that it identifies this file as a join logical file. The JFILE keyword is not allowed with the PFILE keyword.

The JFILE keyword is required at the record level in a join logical file. The JFILE keyword requires a minimum of two physical file names. You can specify the same file name more than once.

The first file is called the primary file, which is the file from which the join begins. All other files are called secondary files. Up to 255 secondary files can be specified (256 total files on the JFILE keyword).

Distributed data management (DDM) files are allowed on the JFILE keyword only when the logical file is being created on a remote system.

The following considerations apply to the order in which you specify physical files on the JFILE keyword:
  • If the physical files have a different number of records, specify physical files with fewer records toward the left on the JFILE keyword. The primary file should have as many or fewer records than the secondary files. This can improve performance when reading files.
  • Primary and secondary files specified in join specifications must be in a specific order. This order depends on the order in which the files are specified on the JFILE keyword. See Example 3 in JOIN (Join) keyword—join logical files only.
  • The JOIN and JREF keywords can use relative file numbers to identify files specified by the JFILE keyword. The first file specified on the JFILE keyword has relative file number 1, the second file has relative file number 2, and so on up to 256. If you use relative file numbers instead of file names on the JOIN and JREF keywords, the order of files on the JFILE keyword can affect the way the JOIN and JREF keywords are specified.
Note: If the names in the physical file are not unique, you must specify relative file numbers.

Examples

The following examples show how to specify the JFILE keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R JREC                      JFILE(PF1 PF2)
00020A          J                           JOIN(PF1 PF2)
00030A                                      JFLD(NAME1 NAME2)
     A

In the join logical file, PF1 is the primary file and PF2 is the secondary file.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R JREC                      JFILE(MYLIBA/PHYSICAL1 +
00020A                                      MYLIBB/PHYSICAL2 MYLIBC/PHYSICAL3)
00030A          J                           JOIN(1 2)
00040A                                      JFLD(FIELD1 FIELD2)
00050A          J                           JOIN(1 3)
00060A                                      JFLD(FIELD1 FIELD2)
     A

In the join logical file, file PHYSICAL1 in library MYLIBA is the primary file. File PHYSICAL2 in library MYLIBB and file PHYSICAL3 in library MYLIBC are secondary files.