SELECT Customer ... SCAN WHILE ... SELECT Otemp ... SELECT Collat ... SELECT oTemp ENDSCANThis code first selects customer and starts a scan loop, at the end of the loop it selects oTemp, but the ENDSCAN selects customer again. The record pointer is never moving in oTemp so teh same record gets processed over and over again until the customer hits a record that fails the WHILE clause. Also the same record in Collat is hit with an update from the same oTemp record for every customer record.