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
Why did you choose to work with ibm mainframe cobol programming?
Why would you use find and get rather than to obtain?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
how do you reference the printer file formats from cobol programs
Can we change the password using ALTER? anyone tried and changed?
Discuss about changing dataset name in proc.
What is an in line perform? When would you use it? Anything else you wish to say about it.
How do you get the data to code the BMS macro?
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?
What is a scope terminator give example?
What is inspect in cobol ?
How can you get the ksds file records into your cobol program?
How to remove 2 duplicate records and copy only one using job control language?
What is the local-storage section?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there