Hi, I am working on some drug data set and need to specify patients using some drugs. The problem is we have some drug name but the data set contains not exactly same but similar name. The drug name in dataset may contain more word/letter than the name we have in hand. I just used exact match to identify patients using these drugs, so the result looks not correct. My code looks like the following. I just listed two names here, but actually I have many drug names. %macro drugs; %do i = 1 %to 10; data drug; set drug; drug_1=0; drug_2=0; if brandname in ('ADOXA', 'VECTRIN') or genname in ('DOXYCYCLINE HYCLATE', 'QUINACRINE') then drug_1=1; if brandname in ('CIMZIA', 'SIMPONI ARIA') or genname in ('ANAKINRA', 'GOLIMUMAB') then drug_2=1; RUN; %end; %mend; %drugs; Too few patients were identified by the above code. I am thinking to use proc sql and like 'pattern' or =* operator, but not sure if it is a good way to do and also not sure if like or =* can be used with more than one drug names to do search. I am also concerning if sas can do macro and proc sql together. Could you help me write some sample code? Thanks so much!
... View more