Use the Open Query File (OPNQRYF) command to select and omit records

Another method of selecting records is using the QRYSLT parameter on the Open Query File (OPNQRYF) command. The open data path created by the OPNQRYF command is like a temporary logical file; that is, it is automatically deleted when it is closed. A logical file, however, remains in existence until you specifically delete it.

Related concepts
Use Open Query File (OPNQRYF) command