MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Records with reverse chronological order

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Raaj
Beginner


Joined: 03 Nov 2004
Posts: 7
Topics: 3
Location: India

PostPosted: Thu Dec 23, 2004 4:58 am    Post subject: Records with reverse chronological order Reply with quote

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
View user's profile Send private message
enge
Beginner


Joined: 12 Oct 2004
Posts: 78
Topics: 39

PostPosted: Thu Dec 23, 2004 5:55 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Dec 23, 2004 6:28 am    Post subject: Reply with quote

Raaj,

Please search before posting. This topic has been discussed earlier. Check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=493&highlight=copyback

http://www.mvsforums.com/helpboards/viewtopic.php?t=1274&highlight=copyback

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group