read a sequential file in reverse order in COBOL

3 posts / 0 new
Last post
Anonymous
read a sequential file in reverse order in COBOL

Is it possible to read a sequential file in reverse order in COBOL? One possible solution I could think of is to sort the file in reverse order and then read it, but I would want the discussion to be open for other solutions... Regards

"; ; ; ;
Offline
Joined: 12/26/2011 - 06:34
Read Reverse in COBOL
Well, the Enterprise COBOL compiler still supports REVERSED as part of the OPEN. Having said that, suggest you ignore it. REVERSED only works with single-reel datasets (excluding dasd). Why does someone believe this file needs to be read backwards?
Anonymous
there are cases that you need

there are cases that you need to read a file backwards, like for example you need to get the last transaction number of the file and then produce the next transaction file increasing the read transaction number by 1

Log in or register to post comments
Sponsored Listing