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 / narayan
You Can do it through JCL sort. Just add a seq number at the
last position of each record and sort it in descending order
of that seq number.
Here is the exacet code.
SORT FIELSD=COPY
OUTREC=(1,80,SEQNUM,4,ZD)
If your ps file is 80 byte long then this sort card a 4
digit seq num at 81 postion.
Now Sort the file on this seq num in descending
SORT FIELSD=(81,4,ZD,D)
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is the Purpose of POINTER Phrase in STRING command in COBOL?
What is difference between static and dynamic call in cobol?
In which area will you utilize 88 level items in cobol?
What is comp-1 and comp-2?
Whats the difference between search & search ALL?
What is inspect in cobol ?
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
how do you reference the printer file formats from cobol programs
how do you reference the variable block file formats from cobol programs
IF I mention stop run in CICS what happens?
i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc
In COBOL programming, what is PERFORM? What is VARYING?
What are the different open modes available in cobol?
What are declaratives and what are their uses in cobol?
What is an in line perform? When would you use it? Anything else you wish to say about it.