Usage notes for Open Query File (OPNQRYF) command

These usage notes pertain to the examples in the topics that describe how to specify the parameters for the major functions of the Open Query File (OPNQRYF) command and how to use the OPNQRYF command with your high-level language program.

Notes:
  1. 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.
  2. 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, you must 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.
Related concepts
The zero-length literal and the contains (*CT) function
Select records without using DDS
Related tasks
CL program coding with the Open Query File (OPNQRYF) command