Selecting records without using DDS
The Open Query File (OPNQRYF) command provides dynamic record selection. That is, you can request a subset of records in a file without using data description specifications (DDS).
For example, you can select records that have a specific value or range of values (for example, all customer numbers between 1000 and 1050).
- Selecting records using the Open Query File (OPNQRYF) command
These examples show how to select database records using the Open Query File (OPNQRYF) command.
- Specifying a keyed sequence access path without using DDS
The dynamic access path function of the Open Query File (OPNQRYF) command allows you to specify a keyed access path without using data description specifications (DDS).
- Specifying key fields from different files
The Open Query File (OPNQRYF) command supports a dynamic keyed sequence access path over a join logical file. That is, you can specify a processing sequence in which the keys can be in different physical files (DDS restricts the keys to the primary file).
- Dynamically joining database files without DDS
The dynamic join function of the Open Query File (OPNQRYF) command allows you to join files without having to first specify data description specifications (DDS) and then create a join logical file.
- Handling missing records in secondary join files
The system allows you to control whether to use defaults for missing records in secondary files (similar to the JDFTVAL DDS keyword for a join logical file). You can also specify that only records with defaults be processed when you use the Open Query File (OPNQRYF) command.
- Unique-key processing
The Open Query File (OPNQRYF) command supports unique-key processing. It allows you to process only the first record of a group.
- Defining fields derived from existing field definitions
The Open Query File (OPNQRYF) command supports mapped field definitions. That is, you can define fields that are mapped or derived from other fields.
- Handling divide-by-zero errors
Dividing by zero is considered an error by the Open Query File (OPNQRYF) command. However, you can get a zero result and avoid a divide-by-zero error.
- Summarizing data from database file records (grouping)
The group processing function of the Open Query File (OPNQRYF) command allows you to summarize data from existing database records.
- Final total-only processing
The Open Query File (OPNQRYF) command supports final-total-only processing. It is a special form of grouping in which you do not specify grouping fields. The output is only one record.
- Controlling how the system runs the Open Query File (OPNQRYF) command
The optimization function of the Open Query File (OPNQRYF) command allows you to specify how you are going to use the results of the query.
Parent topic:
Using Open Query File (OPNQRYF) command
Related concepts
Usage notes for the Open Query File (OPNQRYF) examples