SELECT Orderlines SCAN FOR &cSomeExpression m.Orderno = OrderLines.Orderno SCAN WHILE Orderno = m.Orderno DO SomeProcessing ENDSCAN ENDSCANIndeed, the first records succeeding the last of each orderno, don't get processed. This is caused by the fact that the ENDSCAN skips records and that in the sample above the last ENDSCAN is executed directly after the first one without processing. This behaviour is by design, so not by any means a bug.