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