Using: SAS Studio 3.8, SAS 9 I want to check one column of each row of a dataset to see if it contains any words from a specified list. There will only be one match, and if there is no match then I want the entry to be indicated as missing. What I want to do is create a new column in the largedataset that will have the word that was matched to. Input data: list.csv: dog, cat, cow largedataset.csv: col1 col2 colToCheck x x abcd/dog/123 x x zxy123cat x x /123cowab x x abcdog Output data: largedataset col1 col2 colToCheck newCol x x abcd/dog/123 dog x x zxy123cat cat x x /123cowab cow x x abcdog dog x x abcdefg . I'm new to SAS and having trouble locating what I need through documentation and other forum answers.However, the "DO OVER" proc seems promising, but also seems to be unsupported? data newdata;
set largedata;
do over list;
if find (colToCheck, list, 'i') then
newCol=list;
else /*else there is no match*/
newCol=.;
end;
run;quit;
... View more