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



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

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

Postby krishnanramesh » Sun Oct 03, 2010 1:31 pm

How to read,write records form bottom from a sequential file in cobol?
krishnanramesh
 
Posts: 4
Joined: Thu Jun 10, 2010 1:53 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby enrico-sorichetti » Sun Oct 03, 2010 1:43 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

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

Postby dick scherrer » Sun Oct 03, 2010 9:48 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

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

Postby steve-myers » Mon Oct 04, 2010 12:22 am

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.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post