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


Please Help Members By Posting Answers For Below Questions

how do you define single dimensional array and multidimensional array in your cobol?

887


Give some examples of command terminators?

966


which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad

1251


Name some of the examples of COBOl 11?

2904


Define cobol?

1087


What are declaratives and what are their uses in cobol?

963


What is perform what is varying?

943


What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?

875


Differentiate between structured cobol programming and object-oriented cobol programming.

859


What are literals?

881


What kind of error is trapped by on size error option?

980


) how do u code after getting data?

1834


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

953


Difference between cobol and cobol-ii?

962


What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

927