Hi, I don't think PRXCHANGE is the perfect match for what you are doing. I think you want to identify the place in the string that the characters begin to be alphabetic, which signifies the beginning character position of the units. PRXMATCH will help you start. SUBSTR gets you the rest of the way. Of course this fails us when Drug_Strength becomes something like "5MG-1000MG" libname user "C:\MisMatch_C_07212015.xls"; Data L ; if _N_ = 1 then do; retain PerlExpression; pattern = "/[A-Z]/"; PerlExpression = prxparse(pattern); end; Set 'result#srx$'n (drop=var2 var3); length var2 var3 $ 32; IF Index(DrugName,'MG') > 0 then do; start = prxmatch(PerlExpression, Drug_Strength); if start>0 then do; var2=compress(substr(Drug_Strength,1,start-1)); var3=compress(substr(Drug_Strength,start,32)); end; end; run;
... View more