| Date: | Wed, 2 May 2007 19:42:35 -0700 |
| Reply-To: | David L Cassell <davidlcassell@MSN.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | David L Cassell <davidlcassell@MSN.COM> |
| Subject: | Re: Cleaning ICD9 codes |
| In-Reply-To: | <1178118932.424893.155660@n76g2000hsh.googlegroups.com> |
| Content-Type: | text/plain; format=flowed |
|---|
>On May 1, 4:04 pm, jofo <joey.fo...@gmail.com> wrote:
> > Hi All,
> >
> > I have some ICD9 codes that I would like to standardize before I
> > search through.
> >
> > Some have decimals, most do not.
> >
> > I would like to remove the decimal or space in place.
> > I tried this...
> >
> > data nodot;
> > set test;
> > array dx{8} $ dx1-dx8;
> > array dxcode{8};
> >
> > do i=1 to 8;
> > if length(dx{i})then do;
> > dxcode{i} = prxchange('s/(?:(.+)((\.)|(\s))(\d+))/$1$3/',0,
> > dx{i});
> > end;
> > end;
> > run;
> >
> > This fails miserably though.
> >
> > Anyone know of a way to remove a dot or space from the middle of the
> > code?
> > Anyone know if this is a bad idea and should be avoided?
> >
> > Thanks.
"This fails miserably" is a really uninformative error message. :-)
I think that you have some serious problems in your regex, and your
PRX function, so maybe a much simpler approach would be better.
Start by *not* ruining the ICD-9 codes at all.
If you have to write complex regexen, get a copy of RegexBuddy
(shareware) to verify that your regex is doing what you think.
Or at least use PRXDEBUG so that SAS spits out in the log what *it*
thinks your regex means. That should help you fix the regex, at
least.
HTH,
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330
_________________________________________________________________
Need a break? Find your escape route with Live Search Maps.
http://maps.live.com/default.aspx?ss=Restaurants~Hotels~Amusement%20Park&cp=33.832922~-117.915659&style=r&lvl=13&tilt=-90&dir=0&alt=-1000&scene=1118863&encType=1&FORM=MGAC01
|