When you define a query with the FIELDS phrase, make sure that you include (in the list of fields) the index that the query will use when you open the query with the INDEXED-REPOSITION keyword. Otherwise, you will get an error when the query is re-opened and it attempts to reposition on a field that it cannot find.