Usage notes for the Open Query File (OPNQRYF) examples
These usage notes apply to the examples in the Selecting records without using DDS topic, which describe how to specify the parameters for the major functions of the Open Query File (OPNQRYF) command and how to use the OPNQRYF command in your high-level language program. Notes:
- If you run the OPNQRYF command from a command entry line with the OPNSCOPE(*ACTGRPDFN) or TYPE(*NORMAL) parameter option, error messages that occur after the OPNQRYF command successfully runs will not close the file. Such messages would have closed the file prior to Version 2 Release 3 when TYPE(*NORMAL) was used. The system automatically runs the Reclaim Resources (RCLRSC) command if an error message occurs, except for message CPF0001, which is sent when the system detects an error in the command. However, the RCLRSC command only closes files opened from the default activation group at a higher level in the call stack than the level at which the RCLRSC command was run.
- After running a program that uses the OPNQRYF command for sequential processing, the file position is normally at the end of the file. If you want to run the same program or a different program with the same files, position the file or close the file and open it with the same OPNQRYF command. You can position the file with the Position Database File (POSDBF) command. In some cases, a high-level language program statement can be used.
Parent topic:
Using Open Query File (OPNQRYF) command
Related concepts
Selecting records without using DDS
CL program coding with the Open Query File (OPNQRYF) command
The zero-length literal and the contains (*CT) function