Hi
I have a dataset that looks like this :
PersonId Name PhoneNumber
2 john 111
2 john 222
3 mike 333
3 mike 444
3 mike 555
4 sue 666
4 sue 777
4 sue 888
4 sue 999
it needs to look like this :
PersonId Name PhoneNumber1 PhoneNumber2 PhoneNumber3 PhoneNumber4
2 john 111 222 - -
3 mike 333 444 555
4 sue 666 777 888 999
Any ideas ?
proc transpose data=have out=want (drop=_name_) prefix=PhoneNumber;
by personid name;
var phonenumber;
run;
proc transpose data=have out=want (drop=_name_) prefix=PhoneNumber;
by personid name;
var phonenumber;
run;
Thanks - much appreciated !
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.