It's never a good idea to sort by RECNO(). Data should not depend on the order of records. This is a basic concept on DBFs.
You need to have some other way to mark the dependency of records, for example a synthetic PK and relationship that points inside the table. Again this PK is not for order purposes, there must be some different information you use to order.
I have not looked close to your data to analyze what you are doing with this forward and backward skipping, Normaly there is a better approach.
Lutz
>Processing performance has increased tremendiously. But one another issue has been created.
>Since the file size or Data is too huge sorting records by RECNO() in a cursor is taking a long time.
>
>In other words my processing time has decreased but the time taken for builting a Cursor using RECNO() as sort key and again at the end ordering it in sorkey takes a lot time.
>
>Ultimaltely the effective time of entire process has not significantly decreased, though after creation of cursor the process is very very fast.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]