Date: Tue, 12 May 2009 13:28:36 -0700
Reply-To: "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Subject: Re: Can't remove what appear to be blanks
Content-Type: text/plain; charset="iso-8859-1"
Having an editor that can display in hex
is handy to see what they really are. You
can use SAS to see the byte values as well.
See posting in the last couple days for a
However, what you describe we can probably
surmize without it.
Obviously you are wanting to keep the ¬
characters. These bytes have a hex value
of C2 which is 194 decimal. IF it is the
spaces you see inbetween these, if a reader
of these posts tries to copy and paste them
and apply a compress() function to it, you
will see that the spaces do indeed disappear.
From what you say, if you couldn't get rid
of them before is probably because they were
space characters with the highbit set. i.e.
a normal space character is a byte value of
32 decimal(20hex). The original value was
probably A0(160decimal). Many times email
and other applications and editors will filter
the highbit off of A0 spaces but let everything
The test for this would also work as the
solution for this.
Try (of course with the original data) changing
compress(trim(left(customer_name)),"- ' ")
compress(trim(left(customer_name)),"- ' "||byte(160))
Hope this is helpful.
Investment Business Intelligence
Investment Management & Research
Global Leaders in Multi-Manager Investing
The byte() function above will add an A0 byte
to your list of characters to filter out.
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Scott Murff
Sent: Tuesday, May 12, 2009 1:15 PM
Subject: Can't remove what appear to be blanks
Has anyone ever had the problem of not being able to remove what appear to
be blanks in a string?
I copy and pasted two cells from the view table.
This is the string before attempting to remove the blanks.
SCOTT SAMUELS ¬ ¬ ¬ ¬ ¬ ¬ ¬ ¬ ¬ ¬ ¬ THE THIRD
I then run this code:
create table customer as
select distinct customer_name,
compress(trim(left(customer_name)),"- ' ") as name
order by customer_name;
This is the string in the new table.
SCOTTSAMUELS¬ ¬ ¬ ¬ ¬ ¬ ¬ ¬ ¬ ¬ ¬ THETHIRD
You will notice how the space between THE and THIRD is gone, but not the
other what appear to be spaces.
Any ideas? Thanks.