BookmarkSubscribeRSS Feed
Talita28
Calcite | Level 5

Hi all!

I have a data set with a bunch of Numbers and then an user number like eg.below. I want to delete all the characters from "-" and include only the numbers before "-" for each number. Any help with SAS code is much appreciated.

 

Thanks!

 

Number

4050123456-1

4098765478-1

4901898089898999-1

 

Want:

Number_New

4050123456

4098765478

4901898089898999

1 REPLY 1
Tom
Super User Tom
Super User

The SCAN() function will do that.

Number_New = scan(number,1,'-');