Dear Experts,
I was asked an interview Question recently, which is as follows:
I have a file with a Header and 25 data records (assume Fixed length records). What is the logic to reverse the order of the data-records.
Let's take an example for better understanding.
Input file should like :
Header 2011/01/23 15
record 1
record 2
record 3
record 4
record 5
record 6
record 7
record 8
record 9
record 10
record 11
record 12
record 13
record 14
record 15
Output file should look like
record 15
record 14
record 13
record 12
record 11
record 10
record 9
record 8
record 7
record 6
record 5
record 4
record 3
record 2
record 1
Header 2011/01/23 15
How you can achieve this when the i/p file
1) Sequential File
(i) Using COBOL program (ii) Using JCL
2) VSAM File
(i) Using COBOL program (ii) Using JCL
Please answer this Question