View previous topic :: View next topic |
Author |
Message |
Raaj Beginner

Joined: 03 Nov 2004 Posts: 7 Topics: 3 Location: India
|
Posted: Thu Dec 23, 2004 4:58 am Post subject: Records with reverse chronological order |
|
|
Hi All,
I have 05 Records in a file which is sequential. I would like to read it in the reverse order.
Eg.
0000000001
0000000002
0000000003
0000000004
0000000005
and the O/p should be
0000000005
0000000004
0000000003
0000000002
0000000001
Is there any READ with Reverse Option. Pl. post your suggestions.
Regards,
Raaj. |
|
Back to top |
|
 |
enge Beginner
Joined: 12 Oct 2004 Posts: 78 Topics: 39
|
Posted: Thu Dec 23, 2004 5:55 am Post subject: |
|
|
whitout external sort and internal sort statement i propose:
a) open file and read next until eof ,counting records number.(e.g. counter = 100)
b) close file
c) open file readind records until counter = 100
d) close file
e) open file and read until counter - 1
f) close file
g) open file and read until counter -2
and so on ... until counter = 0
do you like this solution?
bye |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
|
|