Page 1 of 1

How to read,write records form bottom from a sequential file

PostPosted: Sun Oct 03, 2010 1:31 pm
by krishnanramesh
How to read,write records form bottom from a sequential file in cobol?

Re: How to read,write records form bottom from a sequential file

PostPosted: Sun Oct 03, 2010 1:43 pm
by enrico-sorichetti
as already told gazillions times... it cannot be done ( the reading )

please explain better about the write

to process backwards You will have to <sort> in reverse order using a real / virtual sequence key
and sort again in the original sequence

but if the need is <real> the process should be revisited

Re: How to read,write records form bottom from a sequential file

PostPosted: Sun Oct 03, 2010 9:48 pm
by dick scherrer
Hello,

write records form bottom from a sequential file
When records are written to a sequential file, they are always written at the "bottom".

As Enrico requested - explain better so someone can help.

Re: How to read,write records form bottom from a sequential file

PostPosted: Mon Oct 04, 2010 12:22 am
by steve-myers
What an idiot I can be! Of course you write to the "bottom" of a sequential data set!

As for reading from the end of a sequential data set, write it to tape and then reread the tape in backwards mode. Or, as enrico-sorichetti said, sort it into reverse order to a new data set and read the new data set normally.