@Patrick
This found the variables but ascribed zero to all of them
data want;
set have;
if diagnoses in: ('J45.10', 'J45.20', 'J45.30') then AI=1;
else AI=0;
run;
I switched it with AI =0 if any of the variables are found (see below) and it correctly ascribed 1 to all of them. It's weird! I want to ascribe AI=1 in any cell it finds 'J45.10', 'J45.20', 'J45.30' and AI=0 otherwise
I have over 14,000 observations with a column 'diagnoses' which has text information beyond these alphanumeric variables: 'J45.10', 'J45.20', 'J45.30' and I wish to find where this exist in each diagnoses cell. Thanks
data want;
set have;
if diagnoses in: ('J45.10', 'J45.20', 'J45.30') then AI=0;
else AI=1;
run;
... View more