I have a data table that consists of customers ID's and their telephone numbers in the following manner:
Customer ID | telephone number |
---|---|
5550 | 9613456789 |
5550 | 9613657894 |
6758 | 9611567854 |
Which function enables me to have the following format :
Customer ID | telephone number 1 | telephone number 2 |
---|---|---|
5550 | 9613456789 | 9613657894 |
6758 | 9611567854 | . |
Thank you in advance for all your help
Hello,
data have;
input Customer_ID telephone_number $;
datalines;
5550 9613456789
5550 9613657894
6758 9611567854
;
proc transpose data=have out=want(drop=_name_) prefix=Telephone;
by Customer_ID;
var telephone_number;
run;
Have a look at proc transpose.
Hello,
data have;
input Customer_ID telephone_number $;
datalines;
5550 9613456789
5550 9613657894
6758 9611567854
;
proc transpose data=have out=want(drop=_name_) prefix=Telephone;
by Customer_ID;
var telephone_number;
run;
Thank you that was very helpfull
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.