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 !
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.