Im trying to read two variables from a dataset and loop them into another dataset until I get to the end of the file. I am basically outputting to see if these words from the first data set are in any of the observations in the second dataset. It runs, it just picks up everything. Can anyone show me where my logic has gone wrong? %global word1 word2; data _null_; set jessica.TwoWordsFeb; call symput('word1', Word1); call symput('word2', Word2); CALL SYMPUT( 'TOTOBS' , _N_ ); run; /*Runing prxmatch for word groupings*/ /*This looks at user defined particular words in the string*/ %MACRO LOOP; %do i=1 %to &TOTOBS; data temp; set jessica.PercentImpFEBMar ; if prxmatch("/&word1./",search_term) gt 0 and prxmatch("/&word2./",search_term) gt 0 then output; run; %end; %mend; %loop;
... View more