I would like to create new columns variable using criteria matched in prxmatch.
The first variable 'NEW' is Y if:
a. (A= "YES", B="NO" and C="PRESENT") or
b. (B="NO" and C="MAYBE") or
c. (B="NO" and C in ("NO/FL", "T2/FL "))
else N
The second variable 'NEXT' is Y if:
A = 'NO' and B = 'NO' and E = 'Y'
else N
and the last variable NEWER is Y if
A = 'NEW'
Below is my code but I can't get prxmatch() to work
DATA TEST;
SET TEST.TEST;
if A = 'NO' and B = 'YES' and C = 'PRESENT' then NEW = 'Y';
else if B = 'NO' and C = 'MAYBE' then NEW = 'Y';
else if prxmatch('m/NO/FL|T2/FL/oi', C) > 0 and B = 'NO' then NEW = 'Y';
else NEW = 'N';
if A = 'NO' and B = 'NO' and E = 'Y' then NEXT = 'Y';
else NEXT = 'N';
if A = 'NEW' then NEWER = 'Y';
RUN;
PROC PRINT DATA = TEST;
RUN;