How to read records in reverse order in flat file?
I know we can do it by reading all records into an array....
Then read records in reverse order by using subscript or index
but can any body give me the exact code.
Answer Posted / muttaiah
Narayan if we use your sort card we will get records in
reverse order but along with sequence numbers in cols 81-
84. You are not trimming the seq numbers
Stp1:
SORT FIELSD=COPY
OUTREC=(1,80,SEQNUM,4,ZD)
stp2:
SORT FIELSD=(81,4,ZD,D)
Outrec=(1,80)
The output file will have the records in reverse order.
Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
What is the difference between binary search and sequential search?
Why would you use find and get rather than to obtain?
Which Search verb is equivalent to PERFORM…VARYING?
What is link edit in cobol?
Write a program that uses move corresponding.
Explain about different table spaces.
Discuss about changing dataset name in proc.
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
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 ?
What is the Purpose of Pointer in the string?
HOw can I get the negative sign while deduct high value from low value
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?
2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic
What is rmode(any) ?