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
What is length is cobol?
Why occurs cannot be used in 01 level in COBOL?
Whats the difference between search & search ALL?
Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?
How do you differentiate between cobol and cobol-ii?
What is an in line perform? When would you use it? Anything else you wish to say about it.
what is s000 u4087 error? please give the all error codes in cobol,jcl.
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
explain sorting techniques in cobol program?
how do you reference the ksds vsam file formats from cobol programs
What is the usage of comp fields in cobol?
How to remove 2 duplicate records and copy only one using job control language?
What is the difference between next sentence and continue in cobol programing language?
What is Pic 9v99 Indicates in COBOL?