Valid record conditions :-
1. First 3 bytes must be LAT. If as in 3rd record, there is no LAT, then we have to apend LAT to that record and make it valid.
2. second field must always be equal to 123456789. Any other 9 byte will make the record invalid. In above file 4th record is invalid
3. 4th field must always have some values. As in 6th record if there is no value in that field, then that record is invalid.
4.5th field must always have some values. As in 7th record If there is no value in that field, then that record is invalid.
5. 6th field must be always a character 'C'
The records which satisfy all the above conditions must be written to OUTPUT.GOOD.FILE and any records which does not satisfy any one of the above validations must be written to OUTPUT.ERROR.FILE
Can this be achieved using a single sort step ?
If yes, how will my DFSORT code be ?