Requirement : Check if the file has duplicate trailer record, remove if present.
Length of file : FB 100
Trailer record is identified by record type ' 002'
Input File :
ABC 001 December162014
ABC 100 MATHS
ABC 200 SCIENCE
ABC 300 PHYSICS
ABC 002 003
ABC 002 004
ABC 100 MATHS
ABC 200 SCIENCE
ABC 300 PHYSICS
ABC 002 003
ABC 002 004
Output file :
ABC 001 December162014
ABC 100 MATHS
ABC 200 SCIENCE
ABC 300 PHYSICS
ABC 002 003
ABC 100 MATHS
ABC 200 SCIENCE
ABC 300 PHYSICS
ABC 002 003
Initially i have planned to use COUNT, IFTHEN and REMOVE function. Am yet to code, before which i want to check if we have better way to resolve this issue.