How to read records which is in sequential file in reverse
order ? Exp. 1 2 3 4 5 . i want 5 4 3 2 1?please clear my
doubt any one

Answer Posted / mustafa i

Abhishekh your logic is correct
just to add to it
we can even do it by reading the file only once.

1)Read File & Move into an array until EOF also increment a
counter after every read.

3)By decrementing the Counter and using it as subscript
we can now read the array and hence the file in
reverse order.

Is This Answer Correct ?    10 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

1948


What is the difference between perform … with test after and perform … with test before?

868


Explain what you understand by passing by value.

685


What is the difference between comp and comp-3 usage?

669


Write some characteristics of cobol as means of business language.

611






How arrays can be defined in COBOL?

658


State the various causes of s0c1, s0c5 and s0c7.

656


In COBOL programming, what is PERFORM? What is VARYING?

665


Explain how you can characterize tables in cobol?

634


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1831


Which mode is used to operate the sequential file?

654


What are the pertinent COBOL commands?

2617


Difference between cobol and cobol-ii?

698


IF I mention stop run in CICS what happens?

1886


How do u write test cases?

1631