First do you even need to transpose the data at all? What are you doing with it? Perhaps you can analyze it in a the original tall-skinny format. Second the variable NAME cannot be longer than 32, but you could use the product name as the LABEL instead. data have ; length CustomerNum $20 Product $200 Status $3 ; input CustomerNum Product Status ; cards; 1234567 Product1 Yes 1234567 Product2 No 1234567 ProductHasaVariableNamethatiswelloverthe32byterestrictioninTranspose Yes ABCDEF Product2 Yes ;;;; proc sort ; by product ; run; data have2 ; do until (last.product); set have ; by product ; _name_='VAR'||put(_n_,Z4.) ; output; end; run; proc sort ; by customernum _name_ ; run; proc transpose data=have2 out=want (drop=_name_) ; by customernum ; id _name_; idlabel product ; var status ; run; proc print; run; proc print label ; run;
... View more