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 / abhishek
i am giving you pseudo code of same
suppose we have 5 records
rec-no 1-->10
rec-no 2-->1
rec-no 3-->25
rec-no 4-->35
rec-no 5-->20
read sequential file to get record count of file
close file
define an array whose size is equal to record count of file
open file
read file in loop
move current record of sequential file to last subscript of
array define above ( this can be taken care using perform
varying)
read the array starting from subscript 1 to record count
this will be similar to reading sequntial file in reverse
order.....
thanks,
Abhishek
| Is This Answer Correct ? | 23 Yes | 0 No |
Post New Answer View All Answers
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
What type of SDLC u followed? Why?
What are the rules of the move verb?
What is the difference between comp and comp-3 usage?
What are declaratives and what are their uses in cobol?
How to know whether the module is dynamical or statistical?
How arrays can be defined in COBOL?
How do we get current date from system with century in COBOL?
What is the difference between PIC 9.99 and 9v99 in COBOL?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?
What are the different data types in cobol?
Explain how to differentiate call by context by comparing it to other calls?
What is length is cobol?
how can i see junk values in dclgen or in hostvariable of comp ?