Note also that it will be formatting the count for each input record. Means client paying for more CPU on the Mainframe, rather than the program that can't understand that 025 is the same as 25 is the same as 000000000000000025 being changed. Heck, even Excel understands it, you have to go out of your way to make it not work.

Well, you changed it. Please look at the original example. Other than there being two counts, it is the same requirement as yours. So you can't just take some of the code from one place and put it in another, more convenient, place. Arun would have thought of that originally. The reason he wrote that code is because you can't, at all, do what you just tried.

Re-read the link. Re-code. Remember that I noted you have to do it on each record. If that is true, how did you even think you could just add it to the TRAILER1?

Note also that it will be formatting the count for each input record. Means client paying for more CPU on the Mainframe, rather than the program that can't understand that 025 is the same as 25 is the same as 000000000000000025 being changed. Heck, even Excel understands it, you have to go out of your way to make it not work.