This example shows how to select records using the contains function of the Open Query File (OPNQRYF) command.
OVRDBF FILE(FILEA) SHARE(*YES) OPNQRYF FILE(FILEA) QRYSLT('ADDR *CT "BROADWAY" ') CALL PGM(PGMC) CLOF OPNID(FILEA) DLTOVR FILE(FILEA)
OVRDBF FILE(FILEA) SHARE(*YES) OPNQRYF FILE(FILEA) QRYSLT('%XLATE(ADDR QSYSTRNTBL) *CT + "BROADWAY" ') CALL PGM(PGMC) CLOF OPNID(FILEA) DLTOVR FILE(FILEA)
When the %XLATE function is used on the QRYSLT statement, the value of the field passed to the high-level language program appears as it is in the database. You can force the field to appear in uppercase using the %XLATE function on the MAPFLD parameter.