I have two questions here.
1. How to read a flat file in reverse order?
2. How to read a VSAM KSDS file in reverse order?

In both the cases we donot know the total number of records.

Answer Posted / kingmanish

For the KSDS file we can set the pointer on the last record.
After that use the command READ Previous to read the
records in the reverse order.

I am not very sure about flat file. May be we can use a
turn around.
Sort the file in descending order first and then start
reading.

Is This Answer Correct ?    7 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is difference between cobol and cobol/400

21567


Why would you use find and get rather than to obtain?

690


What is the default value(s) for an initialize and what keyword allows for an override of the default?

697


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

712


How do u write test cases?

1638






) how do u code after getting data?

1580


How do we get current date from system with century in COBOL?

805


Which is not true about evaluate statement

1586


What is perform what is varying?

709


input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.

1783


) How do u handle errors in BMS macro

1510


How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?

2098


what happens if parmparameter passes zero bytes to the program

1667


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

748


Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?

825