Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to remove commas in variables (NEW TO SAS!) 1

Status
Not open for further replies.

croy666

Programmer
Nov 2, 2007
1
GB
Hi all,

I have just started with SAS (as my data was getting to big for Excel).

I have a large amount of data and I need to remove any commas from said data.

The data is basicaly names and adresses etc. so have fields called 1st Name, Surname, Title, House No. etc. etc.

In Excel I would have just used find and replace, however I'm struggerling to see an 'easy' option in SAS, I have tried messing around with scan but am not finding a way forward.

If anyone can assist or point me in the direction of a helpful resource (I have 'The little SAS book') I would be extramly grateful

many thanks
 
Hi,

You could use TranWrd to remove them.

e.g

Code:
TranWrd(trim(Left(Variable_Name)), ","," ")

Basically it searches the variable for a commer and replaces it with whatever you want.. (in this case a space)

Robbie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top