BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BrahmanandaRao
Lapis Lazuli | Level 10

Hi

Guys in below excel sheet i have text data in column  B so in that i want mobile number 

its highlighted by red color for your understanding

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
proc import datafile='c:\temp\New Microsoft Office Excel Worksheet (3).xlsx' out=have dbms=xlsx replace;
run;
data want;
 set have;
 phone_number=scan(___VIT_AP_University_campus__Ina,-2,',');
run;

View solution in original post

7 REPLIES 7
PaigeMiller
Diamond | Level 26

Most of us will not or cannot download Excel files (or any files).

 

Please provide your data according to these instructions: https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/

--
Paige Miller
BrahmanandaRao
Lapis Lazuli | Level 10
Data like that only
PaigeMiller
Diamond | Level 26

@BrahmanandaRao wrote:
Data like that only

Then many of us can't help you. (But, yes you can, by putting in a little effort, turn your data into the format requested, and then we can help you)

--
Paige Miller
BrahmanandaRao
Lapis Lazuli | Level 10
I know solution in excel but i want SAS and Python
PaigeMiller
Diamond | Level 26

So put in a little effort and change it to a SAS data set and give it to us following the instructions. Then we can show you how to use SAS to extract the phone number.

--
Paige Miller
BrahmanandaRao
Lapis Lazuli | Level 10
I did solve using pandas
With same excel sheet without any format modifications after import the file
Ksharp
Super User
proc import datafile='c:\temp\New Microsoft Office Excel Worksheet (3).xlsx' out=have dbms=xlsx replace;
run;
data want;
 set have;
 phone_number=scan(___VIT_AP_University_campus__Ina,-2,',');
run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1127 views
  • 1 like
  • 3 in conversation