4 7 1 Predetermined Join Field Concepts

Visual LANSA

4.7.1 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 4.4.1 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 PJF 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.

Warning

  • Predetermined join fields are very efficient when used to look up descriptions in code files where the file accessed is a high speed table but overuse of this facility could cause the opposite effect, particularly in DBOPTIMISED functions when the accessed file is not a high speed table.
    As a guide, do not access more than 10 to 15 files for Predetermined Join Fields.

Also See

4.7.2 PJF Examples

4.7.3 PJF Example using Personnel System

4.7.6 PJF Considerations

Ý 4.7 Predetermined Join Field Development