data phones;
input ph_number;
cards;
2022933923
4162673894
4345768
9848784697
7436348
8643679
7846
7547
7848699499
7552884
5745
3897
2938
4346
4178
8776
9877
5648
4385
2574
4573774889
3266487997
3734874
;
run;
proc format;
picture ph_y 2000-9999="9999)" (prefix="(")
9999999999="999-999-9999"
9999999="999-9999"
;
run;
data ph;
set phones;
ph_n=put(ph_number,ph_y.);
run;
i need my data like this..
987-645-3676
345-7547
(4777)
As @LinusH mentioned, it is just a matter of getting your ranges right, something like
proc format;
picture ph_y
2000-9999="9999)" (prefix="(")
1000000000-9999999999="999-999-9999"
1000000-9999999="999-9999"
;
run;
You only defined a range in the first format picture, add 1000000000- and 1000000- respectively will solve your problem.
As @LinusH mentioned, it is just a matter of getting your ranges right, something like
proc format;
picture ph_y
2000-9999="9999)" (prefix="(")
1000000000-9999999999="999-999-9999"
1000000-9999999="999-9999"
;
run;
very thankful to the code given by u...
i want become a good programmer in sas...
i need ur valuable suggestions...
kudos in advance..
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.