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 (July 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 15 Jul 2004 18:39:53 -0600
Reply-To:   Alan Churchill <EmailMeDirectly@ThisWebSite-erratix.us>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Alan Churchill <EmailMeDirectly@THISWEBSITE-ERRATIX.US>
Subject:   Re: rxparse rxchange problem

Slightly off topic but a big help when I deal with regular expressions. Try out this utility and see what you think:

http://www.gotdotnet.com/Community/Workspaces/Workspace.aspx?id=01e0dfb7-0182-45cd-94f7-2ed2df2504a9

It is not SAS specific but is a good way to quickly test expressions. I've done a lot of rxparse in SAS but I have not tested between the above and SAS. However, it should work...The source lib is available if someone wants to tie it into the SAS system.

Also, here is a good source for common regular expressions:

http://www.regexlib.com/

-- Alan Churchill

Savian "Bridging SAS and Microsoft technologies" (719) 687-5954

"William Kossack" <kossackw@njc.org> wrote in message news:10fdqcp5krnbifc@corp.supernews.com... > I have the following code > > data dataset2; set dataset; > length labelnew $20; > string = trim(label); > RX = RXPARSE(" ' ' TO '*' "); > call rxchange(RX,999,string,labelnew);run; > > I'm trying to replace spaces in label with '*'. However the label is of > variable length. > > When I remove the length statement RX and rxchange don't work and I > don't get a labelnew. > If I use the length statement it forces the labelnew into 20 characters > and if it is shorter I get a bunch of '*' on the end.


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