Hello I have a data set ( want ) multiple record for same ID and I want to transpose the rows to columns , however few conditions needs to be met first . First of all , Each Logo should have its own Vdata1- 5 , also regionquantity will determind how many logos will appear for a region . Example is the RegionQuantity =2 then just 2 logos should be selected for that ID even if it has 3 record. ( logos) Second , region P start from block 4 - 6 region B start from block 7 - 9 region S start from block 10 - 12 region T start from block 13 - 22 Also the %%name%%. I used proc transpose and created the Vdata1-5 . but i dont think its efficient , also i used alot of If-then after the transpose to determin how many logos each id should get and rename statement to assigned the region 4- 6.. etc . Is there an easy way to do that ? data have; INFILE DATALINES DLM=','; input Fname $ Logo $ Region $ RegionQuantity $ VDATA1 $ VDATA2 $ VDATA3 $ VDATA4 $ Vdata5 $ Priority ID; datalines; Peter,hhLKOM,P,1, ,%%name%%, , , ,1, 1 Peter,TTT1,S,1, , , , , , 2, 1 Peter,BBB2,T,2, , , , , , 3, 1 Peter,HESFD,T,2, , , , , , 4, 1 Peter,RWDFG,T,2, , , , , , 5, 1 John,hhLKOM1,P,1,%%name%%, , , , , 1, 2 John,TTT13,B,1, , , , , ,2, 2 John,BBB23,S,1, , , , , , 3, 2 John,HESFD12,T,2 , , , , , , 4, 2 John,RWDFG11,T,2, , , , , , 5, 2 John,RWDFG15,T,2 , , , , , , 6, 2 Cole,WKOM,P,1, , , , , , 1, 3 Cole,sss1,B,1, , , , , , 2, 3 Cole,BBB232,S,1, , , , , , 3, 3 Cole,H111,T,4 , , , , , ,4, 3 Cole,YWQF1,T,4,%%name%%, , , , , 5, 3 Cole,HEHEJRN,T,4 , , , , , , 6, 3 Cole,FMERETH,T,4 , , , , , , 7, 3 ; run; data want; INFILE DATALINES DLM=','; input ID BLOCK4 $ Block4Data1 $ Block4Data2 $ Block4Data3 $ Block4Data4 $ Block4Data5 $ BLOCK5 $ Block5Data1 $ Block5Data2 $ Block5Data3 $ Block5Data4 $ Block5Data5 $ BLOCK6$ Block6Data1 $ Block6Data2 $ Block6Data3 $ Block6Data4 $ Block6Data5 $ BLOCK7 $ Block7Data1$ Block7Data2 $ Block7Data3 $ Block7Data4 $ Block7Data5 $ BLOCK8 $ Block8Data1 $ Block8Data2 $ Block8Data3 $ Block8Data4 $ Block8Data5 $ BLOCK9 $ BlocK9Data1 $ Block9Data2 $ Block9Data3 $ Block9Data4 $ Block9Data5 $ BLOCK10 $ BlocK10Data1 $ Block10Data2 $ Block10Data3 $ Block10Data4 $ Block10Data5 $ BLOCK11 $ BlocK11Data1 $ Block11Data2 $ Block11Data3 $ Block11Data4 $ Block11Data5 $ BLOCK12 $ BlocK12Data1 $ Block12Data2 $ Block12Data3 $ Block12Data4 $ Block12Data5 $ BLOCK13 $ BlocK13Data1 $ Block13Data2 $ Block13Data3 $ Block13Data4 $ Block13Data5 $ BLOCK14 $ BlocK14Data1 $ Block14Data2 $ Block14Data3 $ Block14Data4 $ Block14Data5 $ BLOCK15 $ BlocK15Data1 $ Block15Data2 $ Block15Data3 $ Block15Data4 $ Block15Data5 $ BLOCK16 $ BlocK16Data1 $ Block16Data2 $ Block16Data3 $ Block16Data4 $ Block16Data5 $ ; datalines; 1,hhLKOM, ,Peter, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,TTT1, , , , , , , , , , , , , , , , , ,BBB2, , , , , ,HESFD , , , , , , , , , , , , , , , , , 2,hhLKOM1,John, , , , , , , , , , , , , , , , ,TTT13, , , , , , , , , , , , , , , , , ,BBB23 , , , , , , , , , , , , , , , , , ,HESFD12, , , , , ,RWDFG11, , , , , , , , , , , , , , , , , 3,WKOM, , , , , , , , , , , , , , , , , ,sss1, , , , , , , , , , , , , , , , , ,BBB232, , , , , , , , , , , , , , , , , ,H111, , , , , ,YWQF1,Cole, , , , ,HEHEJRN, , , , , ,FMERETH, , , , , , ; run; thanks
... View more