Joined: 28 Feb 2014 Posts: 4 Location: down in the sea
Adding trailer on the "key field" and using COUNT and SUM option will solve the problem. But that will insert the trailer record once the key changes. So this solution may still need two steps. But I am sure wizards of mainframes present in the forum will have the solution in a step.