Hi I am trying to concatenate multiple columns bases on condition. Data is as follows. CRN Diff Pay1 Pay2 Pay3 Pay4 Pay5 Pay6 Pay7 Pay8 Pay9 Pay10 1 1 000 084 084 084 000 XXX 000 XXX XXX XXX 2 10 065 000 000 000 000 XXX XXX XXX XXX XXX 3 -1 000 XXX XXX XXX XXX XXX XXX XXX XXX XXX 4 3 XXX 000 000 000 000 000 000 000 000 000 5 -2 070 070 070 070 070 070 070 XXX XXX XXX 6 1 090 XXX XXX XXX XXX XXX XXX XXX XXX XXX The code I am using is as follows. data temp; set temp; format hist $200.; array col(*) Pay1-Pay10; if diff=-1 then hist=catx('',col(2-10)); else if diff=-2 then hist=catx('',col(3-10)); else hist=catx('',col(*)); run; I want concatenate column based on diff=-1 , -2 etc and concat corresponding columns. The error I am getting is "array subscript out of range". Please help.
... View more