Hi , I have a dataset X which has these columns Apple1, Apple2, Orange1, Orange2. Another Dataset Y which looks like below in Dataset Y I have taken list of items I need to check in Data X whether they exist or not . Also, while checking when Apple1 is existing Orange1 should also exist in X dataset . Same thing when Apple2 is existing then Orange2 should also exist then only create output . I am using below code by using prxmatch but it doesnot work test1 test2 Apple1 Orange1 Apple2 Orange2 proc contents data= X noprint out= GTAB (keep=name varnum); run; Then created Y table which looks like below test1 test2 Apple1 Orange1 Apple2 Orange2 data _null_; set Y; call symput('wrd1'||left(_n_), strip(test1)); call symput('wrd2'||left(_n_), strip(test2)); CALL SYMPUT( 'Total' , _N_ ); run; %MACRO LOOP; data temp2; set X ; %do i=1 %to &Total; if (prxmatch("/&&wrd1&i./",NAME) gt 0 and prxmatch("/&&wrd2&i./",NAME) gt 0) then output ; %end; run; %mend; %loop; But this condition is not working and dataset temp2 is empty Can anyone please help Thanks
... View more