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
how do you reference the ksds vsam file formats from cobol programs
What are the different rules to perform a Search?
What is the Purpose of Pointer in the string?
What is a report item?
System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..
IF I mention stop run in CICS what happens?
Difference between cobol and cobol-ii?
How to use the same COBOL program in Batch and CICS on lines? explain with an example
What are the cobol coding sheets?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
What is length is cobol?
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
What are various search techniques in cobol? Explain.
State the various causes of s0c1, s0c5 and s0c7.
How did the release of cobol/370 version 1.3 improve the performance of release 1.1?