There's one input file and three output file. How to write the records in input file through cobol code so that there is equal number of records in each output.
For e.g.
case 1
input file = 60 recs
ouput files:
File 1= 20 recs
File 2=20 recs
File 3= 20 recs
Case 2
input file = 61 recs
ouput files:
File 1= 21 recs
File 2=20 recs
File 3= 20 recs
Case 2
input file = 62 recs
ouput files:
File 1= 21 recs
File 2=21 recs
File 3= 20 recs
So on and so forth....
Number of records in the input file is not known.
This question was faced by me in an interview.
Pls let me know the solution to above query