I’m trying this example below, thought what it does is asserts what immediately follows is not “ dollars”, I expected var2 for the first record “100 dollars” returns null, but instead it returns 10, what should I use if I don’t want any value returned for the first record? data check; var='100 dollars'; output; var='100 pesos'; output; var='USD100'; output; var='JPY100'; output; var='JPYbdl100'; output; run; data check2; set check; *** create the regular expression only once ***; retain re1; if _N_=1 then do; re1 = prxparse('/\d+(?! dollars)/'); end; if prxmatch(re1,var) then do; var2 = prxposn(re1,0,var); end; run; proc print data=check2; run;
... View more