Hello, Thanks for the response, I used that but it is not picking sentences that either have hyphen like 'experince-based'. For instance, the code below is not picking the first sentence data example; comment ="The worst experience-based I've ever had with them. The worst service in a decade. Because of this experience I will not be recommending this gym." ; length extract sentence $200.; do i = 1 to countw(comment,'.'); sentence = scan(comment,i,'.'); if findw( sentence,'Experience',' .,/','i')>0 then do; extract= catx(' ',extract,catt(sentence,'.')) ; end; end; drop sentence i; run; Please advice on how to proceed further. The data I'm working on is not so well written hence I want the code to extract the words that are somewhere in the middle of the strings even if there is no space, say 'CauseExperience-Based' and so on. Thanks a lot!
... View more