>>Can anyone refer me to an authoritative and thorough resource for the many uses for this command? I work with data conversions/translations and use this command daily, but still don't grasp the finer nuances. Any help would be greatly appreciated!
>
>All SCAN...ENDSCAN really does is a DO WHILE loop with an implicit SKIP on each iteration. FOR allows you to specify a filter condition with an implied scope of ALL that examines all records meeting the criteria of the FOR clause; WHILE allows you to specify a filter with an implied scope of REST that terminates as soon as a record that does not meet the criteria of the WHILE condition is encountered.
>
There is one subtle difference between SCAN/ENDSCAN and DO WHILE. Don't move the record pointer of the table being scanned. It gives really unpredicatble results.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer