Sorry, all that &&&&& hurts my eyes. Can you post some sample test data, in a datastep, and what the output should look like. The reason is I can't see why you would need the above code, just use basic datasteps and arrays (or normlise your data). Far easier.
... View more