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 do you define single dimensional array and multidimensional array in your cobol?
i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?
input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?
Give some examples of command terminators?
What is the LINKAGE SECTION used in COBOL?
What guidelines should be followed to write a structured cobol prgm?
Explain what you understand by passing by value.
How to use the same COBOL program in Batch and CICS on lines? explain with an example
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
How you can read the file from bottom?
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
What are the different types of condition in cobol and write their forms.
What are the rules of the move verb?
What are various search techniques in cobol? Explain.
What is the local-storage section?