If you cannot use a logical or OPNQRYF or embedded SQL then your best bet would be to create two tables/arrays, one for YES the other for NO. Then read a record, add to appropriate table/array. On the last record go back and read all record from one table/array then the other. You could even sort them.
Register Hereor login if you are already a member
We are assuming you know the RRNs you what to read and in what order.If they are in another table (in the order you want to read them), then Select Status_from_FileB, RRN-from-FileA, etc. From FileA, FileB Where RRN-from-Filea = RRN(FileB) etc.