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


Please Help Members By Posting Answers For Below Questions

What are the different open modes available in cobol?

713


What is difference between static and dynamic call in cobol?

766


how do you reference the esds vsam file formats from cobol programs

625


What are the different rules for performing sort operation?

753


What are declaratives and what are their uses in cobol?

700






) How do u handle errors in BMS macro

1498


What is inspect in cobol ?

791


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)?

619


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.

1103


Can a Search can be done on a table with or without Index?

796


How you can characterize tables in cobol?

707


how we sort two input files based on a common column and giving one o/p file please send me the coding logic?

1639


What is the utilization of copybook in cobol?

648


Mention the guidelines to write a structured cobol program?

603


Which is not true about evaluate statement

1560