hi, I have a question about the use of prxmatch and arrays. I have a list with multiple different therapies (treat1-treat15). I want to select all chemotherapies from this list and combine different types of chemo that are given as combination therapy. I wrote the syntax below. This works for comparing treat{i} and treat{i+1}, but I also want to compare treat{i} with treat{i+2}, treat{i+3} etc. And preferably also compare treat{i} with treat{i+1} and treat {i+3} at the same time, as there might be up to three or four chemotherapies that need to be combined. Is there an easy way to do this? %let chemo = XY40|BC50|XA60|ZL90|OX15|MZ78; data twee; set een; array treat15} $ treat1 - treat15; array treat_dat{15} treat_dat1 - treat_dat15; array CT{15} CT1-CT15; array CT_dat{15} CT_dat1-CT_dat15; CT=0; do i=1 to 15; if prxmatch("m/&chemo/i", treat{i})>0 and prxmatch("m/&chemo/i", treat{i+1})>0 and treat_dat{i}=treat_dat{i+1} then do; if treat{i}=XY40 and treat{i+1}=BC50 then do; CT{i}=OX15; CT_dat{i}=treat_dat{i}; end; if treat{i}=XY40 and treat{i+1}=XA60 then do; CT{i}=MZ78; CT_dat{i}=treat_dat{i}; end; end; run; Thanks in advance!
... View more