Date: Fri, 28 Apr 2000 09:10:58 -0700
Reply-To: "Lund, Pete" <Peter.Lund@CFC.WA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Lund, Pete" <Peter.Lund@CFC.WA.GOV>
Subject: Re: Getting rid of single quotes
Content-Type: text/plain; charset="windows-1252"
I'd first suggest not being afraid to try something just because you think
it might not work. Your thought of using COMPRESS() works just fine:
test = "Joe's Store";
comp = compress(test,"'");
put test= comp=;
The worst you'd find trying something like this is that it didn't work and
you'd go to plan B. The manual talks about issues of quotes within strings
and ways to handle them. Basically, the most simple rule is to embed
singles within doubles and doubles within singles. That's all you need to
know for your example.
WA State Caseload Forecast Council
(360) 902-0086 voice
(360) 902-0084 fax
From: Foster Kerrison [mailto:foster@CYBERPORTAL.NET]
Sent: Friday, April 28, 2000 9:09 AM
Subject: Getting rid of single quotes
In cleaning up data can I get rid of a single quote (') in a character
variable? For example I might have two records one with 'Joe's Store"
and one with 'Joes store' that I want to merge so I need to get rid of
the single quote in Joe's. I have thought of using the TRANSLATE( ) or
COMPRESS( ) function to do this, but I don't think it will work because
of the single quote.
Foster Kerrison. .