Slightly off topic but a big help when I deal with regular expressions. Try
out this utility and see what you think:
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:
"Bridging SAS and Microsoft technologies"
"William Kossack" <firstname.lastname@example.org> wrote in message
> 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.