Predetermined Join Field Concepts

A Predetermined Join Field or PJF is a special feature of the LANSA Repository. A PJF is a special kind of virtual field. (Refer to Virtual Field Concepts.) Unlike the other types of Repository virtual files, a PJF is a virtual field whose value is determined by a value or values in another file. (Other virtual fields are always based on fields within its own file definition.) PJFs use access routes to determine the file relationships.

A Predetermined Join Field is used to hold the result of various operations performed on information retrieved from the file nominated by the access route. The field must be defined in the LANSA Repository.

The type of operations available to be performed depend on the relationship between the files as indicated by the number of records expected on the access route definition.

When the relationship is 1:many (refer to access route Maximum Records), the operations are TOTAL, MAXIMUM, MINIMUM, AVERAGE, and COUNT. (Also refer to PJC* Type in the Technical Reference Guide.)

When the relationship is 1:1 using the key defined on the access route, a single value LOOKUP will be retrieved into the Predetermined Join Field. For example, a product description can be retrieved using the product code if an access route has been defined between an order line file and a product file. A Keep Last value can be nominated to reduce I/Os.

When the relationship is 1:many (number of records retrieved is greater than 1) the Predetermined Join Field will hold the result of the selected operation on the selected field in the file nominated by the access route, retrieved using the key in the access route definition. For example, the total of the line values from an order line file could be retrieved for display with the order header file.

The access route on which Predetermined Join Fields are defined includes in its definition two attributes which affect Predetermined Join Fields. They are the Keep Last value and the Derivation. Both of these attributes apply to all Predetermined Join Fields defined on the access route.

The Keep Last value only affects Predetermined Join Fields when the access route relationship is 1:1. It causes the last "nnn" values retrieved from the accessed file to be stored in memory and thereby reducing I/Os.

The Derivation attribute nominates when the Predetermined Join Fields are to be retrieved from the accessed file, i.e. either before or after virtual fields which are derived 'After input from file'.

Predetermined join fields will be displayed when prompting for fields in the RDML editor in the same way as virtual fields.

Predetermined join fields are dependent on the access route they are defined on.


* Predetermined Join Column

Also See

PJF Examples

PJF Considerations