CL program coding with the Open Query File (OPNQRYF) command

 

When you use the Open Query File (OPNQRYF) command, follow these rules to prevent coding errors.

In the following example, the fields INVCUS and INVPRD are defined as character data:
QRYSLT('INVCUS *EQ "' *CAT &K1CUST *CAT '" *AND +
        INVPRD *GE "' *CAT &LPRD *CAT '" *AND +
        INVPRD *LE "' *CAT &HPRD *CAT '"')
If the fields are defined numeric data, the QRYSLT parameter can look like this:
QRYSLT('INVCUS *EQ ' *CAT &K1CUST *CAT ' *AND +
        INVPRD *GE ' *CAT &LPRD *CAT ' *AND +
        INVPRD *LE ' *CAT &HPRD *CAT ' ')

 

Parent topic:

Using Open Query File (OPNQRYF) command

 

Related concepts


Usage notes for the Open Query File (OPNQRYF) examples