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
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
What type of SDLC u followed? Why?
What is the difference between structured cobol programming and object alternativelyiented cobol programming?
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?
How to remove 2 duplicate records and copy only one using job control language?
how do you reference the variable block file formats from cobol programs
What is the difference between structured cobol programming and object alternativelyiented cobol?
what happens if parmparameter passes zero bytes to the program
How do you define a variable of comp-1 and comp-2?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
What is difference between static and dynamic call in cobol?
Define cobol?
Can you please let me know the centre name of INS certification in Kolkata.
What rules are followed by the search verb.
1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?