View previous topic :: View next topic
|
Author |
Message |
swapna_b
New User
Joined: 08 Aug 2005 Posts: 1 Location: HYD
|
|
|
|
I need to read a file in reverse order i.e from last to first in cobol but not using jcl, sort or any other files. |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
As of my knowledge COBOL don't support.....reading of file from botom to top.
Only thing is sort and then read.... |
|
Back to top |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
hi
i think u can do it using READ PRIOR statement...
it can be used for VSAM files. not sure whether it can be used for PS files. |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi !
Native cobol ? No way !!!
Regards, UmeySan |
|
Back to top |
|
|
viv Currently Banned New User
Joined: 31 Oct 2006 Posts: 4
|
|
|
|
read the file from the front and put the first record in variable(1) and then in variable(2)......variable(n).. Then try printing the reocrd from variable(n) to variable(1). |
|
Back to top |
|
|
viv Currently Banned New User
Joined: 31 Oct 2006 Posts: 4
|
|
|
|
the above works only if the no of records are of some finite size... |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
@ viv !
That's quiet a nice idea, if your file has 20 records.
Think of a file with one Million records and then have a look at
your needed storage.
Solutions habe to be practical & workable
Regards, UmeySan |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Argh! I'm getting tired of seeing this same question every week, when it has been posted over and over again that this is NOT an option in any of the standard MVS mainframe COBOL products, unless the data resides on tape (and that option is now becoming obsolete). |
|
Back to top |
|
|
|