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
There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.
How many bytes S(8) comp field occupy and its maximum value?
What is the default value(s) for an initialize and what keyword allows for an override of the default?
HOw can I get the negative sign while deduct high value from low value
how do you reference the esds vsam file formats from cobol programs
Write some characteristics of cobol as means of business language.
input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.
When is inspect verb is used in cobol?
Mention the guidelines to write a structured cobol program?
What is the difference between a binary search and a sequential search what are the pertinent cobol?
What is link edit in cobol?
How arrays can be defined in COBOL?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
Can a Search can be done on a table with or without Index?
Write a program to explain size error.