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


Please Help Members By Posting Answers For Below Questions

What is the Purpose of POINTER Phrase in STRING command in COBOL?

723


What is difference between static and dynamic call in cobol?

780


In which area will you utilize 88 level items in cobol?

724


What is comp-1 and comp-2?

766


Whats the difference between search & search ALL?

5272






What is inspect in cobol ?

806


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

691


how do you reference the printer file formats from cobol programs

669


how do you reference the variable block file formats from cobol programs

688


IF I mention stop run in CICS what happens?

1898


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

2108


In COBOL programming, what is PERFORM? What is VARYING?

672


What are the different open modes available in cobol?

722


What are declaratives and what are their uses in cobol?

714


What is an in line perform? When would you use it? Anything else you wish to say about it.

649