Date: Wed, 16 May 2012 14:12:12 -0400
Reply-To: Ya Huang <ya.huang@AMYLIN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ya Huang <ya.huang@AMYLIN.COM>
Subject: Re: using tranwrd to eliminate substrings
Just found out this:
32 data _null_;
33 a = 'abcdefg';
34 c='';
35 b = TRANSTRN(a, 'bcd', trimn(''));
36 put a= b=;
37 run;
a=abcdefg b=aefg
On Wed, 16 May 2012 13:56:22 -0400, Bolotin Yevgeniy
<YBolotin@SCHOOLS.NYC.GOV> wrote:
>(this is not a business problem, only for my own curiosity)
>
>
>
>3458 data _z;
>
>3459 a = 'abcdefg';
>
>3460 b = tranwrd(a, 'bcd', '');
>
>3461 put a= b=;
>
>3462 run;
>
>
>
>a=abcdefg b=a efg
>
>
>
>
>
>
>
>In retrospect, it sort of makes sense ('' and ' ' are equivalent, so the
>system internally uses ' '), but it's still not what I wanted.
>
>
>
>Is there a simple way of making this produce b=aefg, without resorting
>to regular expressions and whatnot?
>
>
>
>
>
>
>
>Yevgeniy (Eugene) Bolotin
>Report Developer, Progress Reports
>NYC Department of Education
>
>(212) 374-7949
>
>ybolotin@schools.nyc.gov <blocked::mailto:mmadow@schools.nyc.gov>
>
>
|