And this traditional one, recalling my initial days where I used to read to voraciously read Guru @data_null__ 's posts and ask/beg him for help. And Guru offered this one(easy one) to cheer me and said "you will have your time soon"
data have;
input (PersonID Color ) ($);* Color_Category;
cards;
31515 Green Multicolor
31515 Blue Multicolor
31515 Green Multicolor
31515 Blue Multicolor
64790 Green Green
64790 Green Green
64790 Green Green
64790 Green Green
83409 Blue Blue
83409 Blue Blue
83409 Blue Blue
83409 Blue Blue
;
proc freq data=have noprint;
tables personid*color/out=temp(keep=personid count);
run;
proc freq data=temp noprint;
tables personid/out=temp2(keep=personid count);
run;
data want;
merge have temp2;
by personid;
length Color_Category $10;
Color_Category=ifc(count>1,'Multicolor',color);
drop count;
run;
Guru DN, dedicating to all your help as always and every time I mention is a way of showing my heartfelt gratitude. Turn on your sense of humor, you must have gone a lot more grey now. lol 🙂
... View more