LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2012, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: Eugene Bolotin <YBolotin@SCHOOLS.NYC.GOV>

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> > >


Back to: Top of message | Previous page | Main SAS-L page