Hi, Base SAS 9.4 user; I'm a first time user of prxmatch but I'm having issues getting it to work in my datastep. I have 2 variables set up in a dataset and I want to cross reference all the words in one variable with all the words in the other variable to see if there were any matches. Here is an example of my code: data xxx ;
x="Drug: Pimavanserin tartrate (ACP-103)" ;
y="Drug: pimavanserin tartrate" ;
output ;
x="Drug: masitinib" ;
y="Drug: masitinib (AB1010)" ;
output ;
run ; What I want now it to see if any of the words in y appear in x, I decided to see if PRXMATCH would work, so I've created a pattern (which hopefully contains all the pearl stuff and the words to match 'm/word1|word2|word3/io') data yyy ;
set xxx ;
/*create pattern to search for*/
pattern='m/'||lowcase(translate(compress(strip(scan(y,2,":")),,"adsk"),"|"," "))||'/io' ;
parse=prxparse(pattern) ;
/*this is my checking criteria... so eventually if z>0 then there is a match with >= 1 of the keywords*/
z=prxmatch(prxparse(pattern),x) ;
run ; What I'm finding is that because the regular expression id (from the prxparse) isn't changing it will only find the first match and then nothing else. Can anyone help? thanks Lindsey
... View more