Thanks guys. Just picked up something after implementing the code you all suggested. See below: 1033162957 1033162952 TEL 01JAN2001 E Anytime 001 1033162957 1033162952 TEL 01JAN2001 E Daytime Only 002 1033162957 1033162952 PAG 01JAN2001 E Anytime 003 The last record has a value PAG in the third field and I will like it to remain 001. In essecnce, the sequence will be 001,002,001 because the field is different in a way. If say we had 2 of each record, that is 2 records with TEL and 2 records with PAG then we should have 001,002,001,002. Sorry I was not aware of this case. Thanks a lot guys.
... View more