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
What are the different open modes available in cobol?
What is difference between static and dynamic call in cobol?
how do you reference the esds vsam file formats from cobol programs
What are the different rules for performing sort operation?
What are declaratives and what are their uses in cobol?
) How do u handle errors in BMS macro
What is inspect in cobol ?
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.
Can a Search can be done on a table with or without Index?
How you can characterize tables in cobol?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
What is the utilization of copybook in cobol?
Mention the guidelines to write a structured cobol program?
Which is not true about evaluate statement