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
i want a program using by if, evaluate , string, unstring, perform, occurs?
What is the difference between Call and a Link?
Explain how to differentiate call by context by comparing it to other calls?
Explain what you understand by passing by value.
What kind of error is trapped by on size error option?
Write a program to enter and display the names of students in a class using the occurs clause.
What is the difference between perform … with test after and perform … with test before?
I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......
What guidelines should be followed to write a structured cobol prgm?
What is inspect in cobol ?
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
What is rmode(any) ?
What are the different data types in cobol?
What are various search techniques in cobol? Explain.
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?