Defining fields mapped from existing fields

The Open Query File (OPNQRYF) command supports mapped field definitions. That is, you can define fields that are mapped or derived from other fields.

Mapped field definitions:
  • Allow you to create internal fields that specify selection values, as shown in Example 7: Dynamically selecting records.
  • Allow you to avoid confusion when the same field name occurs in multiple files, as shown in Example 1: Dynamically joining database files.
  • Allow you to create fields that exist only in the format to be processed, but not in the database itself. This allows you to perform translate, substring, concatenation, and complex mathematical operations. The following examples describe this function.