NOW sequence number is 10-12 ( 3 bytes) - 10TH BITE IS alphabetic and 11-12 are numeric and control break is on field starting from character 5 and length of 5.whenever control break changes sequence number starts again from beginning. In new requirement they want to make this sequence number as alphanumeric and increment and new sequence start from BAA instead of AAA( A sequence is using for some other purpose). New sequence should be like BAA,BAB,BAC.....BAZ,BBA,BBB,..BZZ,...BA1,BA2,BA3...etc

You would VASTLY simplify your logic if you put the sequence in collating sequence (BAA, BAB, ..., BAZ, BA1, BA2, ... BA9, BBA, ...) instead of the way you posted. And I'm not sure why you're having problems with the code --a complete COBOL program to DISPLAY the various letter / number combinations of the sequence ran 46 lines of COBOL when I wrote it a few minutes ago. Doing it the way you posted wouldn't add more than 10 lines to that total, I would think.