DDS for physical and logical files


JFLD (Joined Fields) keyword--join logical files only

Use this join-level keyword to identify the from and to fields whose values are used to join physical files in a join logical file. These fields are both referred to as join fields.

The format of the keyword is:

JFLD(from-field-name to-field-name)

The join fields must correspond to fields in the physical files identified on the JOIN keyword for this join specification. The name you specify on the JFLD keyword must be the same as the name specified in the physical file unless it was renamed in the join logical file. If you do not specify a JOIN keyword, then the JFILE keyword is used.

This keyword is valid only for join logical files.

At least one JFLD keyword is required for each join specification. A join specification is identified by J in position 17. Since at least one join specification is required in a join logical file, you must have at least one JFLD keyword specified in a join logical file.

These fields need not also be specified as fields in the record format for a join logical file.

To specify additional join fields to use when joining physical files, specify more than one JFLD keyword.

The field names you specify on the JFLD keyword must either be specified at the field level in the join record format or in one of the physical files, which are specified on the JFILE keyword.

The OS/400 program uses the following search order to match join field names with defined fields:

  1. Fields specified in the join logical file at the field level in positions 19 through 28.
    Note:
    Fields that specify the CONCAT, RENAME, or SST keywords are valid as join fields; fields that are specified on CONCAT, RENAME, or SST keywords cannot be join fields.
  2. Fields in the physical file specified on the JOIN keyword.

The rules for specifying join fields are as follows:

Examples:

The following examples show how to specify the JFLD keyword.

Example 1:

|...+....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, the JFLD keywords specify that NAME1 in physical file PF1 is used to join to NAME2 in physical file PF2.

Example 2:

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

In the join logical file, the JFLD keywords specify that NAME1 and ADDR1 in physical file PF1 are used to join to NAME2 and ADDR2 in physical file PF2.


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