| Date: | Mon, 4 May 2009 23:58:29 +0100 |
| Reply-To: | karma <dorjetarap@GOOGLEMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | karma <dorjetarap@GOOGLEMAIL.COM> |
| Subject: | Re: Weird Character String |
|
| In-Reply-To: | <ce1fb7450905041546x3b11c344qfb2fcc1bf4cf953b@mail.gmail.com> |
| Content-Type: | text/plain; charset=ISO-8859-1 |
Excellent, just looked up control characters, wasn't aware of these.
Thanks once again!
2009/5/4 ./ ADD NAME=Data _null_; <iebupdte@gmail.com>:
> 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.
>> > :)
>> >
>>
>
|