OPNQRYF and SQL essentially use the same engine code to select and reject records, so the two interfaces behaving differently should not occur very often. Is it possible that SQL is returning the rows in a different order instead of not selecting the right records? This is possible with SQL since the order of the results is only guaranteed when an ORDER BY clause is included on your SQL request. If ordering of the result rows is not the problem, then I'd suggest that you make sure you have the latest database group PTF. If you have the latest fixes and the problem still persists, then report this as a defect to IBM Support.
================================== MORE INFORMATION ON THIS TOPIC ==================================
Search400.com's targeted search engine: Get relevant information on DB2/400.
The Best Web Links: tips, tutorials and more.
Check out this online event, Getting the Most out of SQL & DB2 UDB for the iSeries.
This was first published in April 2003