I have some data about chemotherapy and other medical procedures in a variable (called "desc") in one of my datasets. I want to code whether or not each entry in this variable is chemotherapy using information from a variable in another dataset (called "names").
Often, the lowcase() version of the variables matches and so linking and coding are easy. In some cases though, the variable I'm trying to code is a longer string and I need to determine if the chemotherapy name in the second variable is somewhere inside it. An added complication is that "desc" can match more than one value in "names," but I don't want to wind up with multiple rows for "desc" whenever this is the case.
I've provided some sample data below to illustrate what I'm trying to do. I've been trying to link the rows using proc sql and the index function but am unable to link properly for strings like "5FU/Fluorouracil" and "Leucovorin Calcium."
Is there some easy way to get the result I need?
input desc $ 1-25;
input names $ 1-25;
length desc $ 25;
input desc $& chemo $;
Leucovorin Calcium Yes