Date: Mon, 4 May 2009 17:46:33 -0500
Reply-To: "./ ADD NAME=Data _null_;" <iebupdte@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "./ ADD NAME=Data _null_;" <iebupdte@GMAIL.COM>
Subject: Re: Weird Character String
In-Reply-To: <d6a0d8f10905041525v518a2a84ld8fa14a0ed73c572@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
X is for the 16 hex characters 0-9 A-F. You want C to remove control
characters.
data test;
x='0A'x ;
a='0A Karma';
b = compress(a,,'x');
y = compress(x,,'c');
z = compress(x,,'kw');
run ;
proc print;
run;
On 5/4/09, karma <dorjetarap@googlemail.com> wrote:
> According to the docs here
> (http://post.queensu.ca:8080/SASDoc/getDoc/en/lrdict.hlp/a000212246.htm).
> It looks like we should be able to use X in the third argument of the
> compress function, but it doesn't seem to work for me.
>
> Data null's idea seems to work (of course!).
>
> data test ;
> x='0A'x ;
> y = compress(x,,'x');
> z = compress(x,,'kw');
> run ;
>
> 2009/5/4 Terjeson, Mark <Mterjeson@russell.com>:
> > to get rid of:
> >
> > x = compress(x,'00'x);
> >
> > or
> >
> > x = compress(x,byte(0));
> >
> >
> >
> > to replace with space:
> >
> > x = translate(x,' ','00'x);
> >
> > or
> >
> > x = translate(x,' ',byte(0));
> >
> >
> > e.g.
> >
> >
> > data _null_;
> > x = 'Hello'||byte(0)||'World';
> >
> > y = compress(x,byte(0));
> >
> > z = translate(x,' ',byte(0));
> >
> > put _all_;
> > run;
> >
> >
> >
> > Hope this is helpful.
> >
> >
> > Mark Terjeson
> > Investment Business Intelligence
> > Investment Management & Research
> > Russell Investments
> > 253-439-2367
> >
> >
> > Russell
> > Global Leaders in Multi-Manager Investing
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
> > Monal Kohli
> > Sent: Monday, May 04, 2009 3:03 PM
> > To: SAS-L@LISTSERV.UGA.EDU
> > Subject: Re: Weird Character String
> >
> > I tried everything , compress, strip , compbl
> > But nothing worked to remove the hex character.
> > :)
> >
>
|