I need help in coding a cobol program .The requirement goes like this

Input file has three fields . i.e Value A, Value B and Value C. For every unique Value A and Value C combination , I need smallest Value B.

Sample Input file

abcd 10000 905

abcd 10 905

abcd 9000 906

pqrs 100 906

pqrs 100 906

abcd 10 905

abcd 9000 906

pqrs 100 906

pqrs 100 906

For Value a = abcd and Value c = 905 combination , the smallest Value b is "10".So the output file should be like "abcd 10 905"

Similarly , For Value a = abcd and Value c = 906 combination , the smallest Value b is 9000, So the output file should be like " abcd 9000 906".

Expected Output file :

abcd 10 905

abcd 9000 906

pqrs 100 906

abcd 9000 906

pqrs 100 906

Am a beginner in Cobol and Can someone help me how to code for this requirement in COBOL.

Code'd