I would like to know who has got Apple and Pear.
Output expecting to see John and Grant only.
Here is my code:
data person;input name $ products$;datalines;John AppleJohn PearMary Apple
Helen AppleHelen OrangeGrant AppleGrant Pear;
Thanks
proc sort data=person; by name;run;proc transpose data=person out=person_t(drop=_name_); by name; var products;run;data person2; set person_t; all_prods=catx(',',of col:); if prxmatch('/Apple,Pear|Pear,Apple/i',all_prods);run;
View solution in original post
What have you tried?
Do you want a dataset or a report?
In both cases: use a where statement.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Submit your idea!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.