BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
vrushankshah
Fluorite | Level 6
I am sorry I meant fianl update to the question is done how the output I am expecting but when I run your code it is not giving the expected output can you please check once again !! Thank you !
PeterClemmensen
Tourmaline | Level 20

Ah ok. This gives you the final required output

 

data have;
length Column1 $200;
input Column1 $ group;
datalines;
Benefits,verify                           1
claims,verify,benefits,verify             2
inquiry,type                              3
claims,verify                             4
Benefits,verify,inquiry,type,Benefits     5
Benefits                                  6
Benefits                                  7
;

data want(keep=Column1 Part_Of_Group count);
   set have nobs=nobs;
   count=0;
   do _N_=1 to nobs;
      set have(rename=(Column1=compColumn1 group=compGroup)) point=_N_;
      if find(compColumn1, Column1, 'it') ne 0 & group ne compGroup & countw(Column1, ",")>1 then do;
         Part_Of_Group=compGroup;
         count+1;
         output;
      end;
   end;
   if count=0 & countw(Column1, ",")>1 then output;
run;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 16 replies
  • 2871 views
  • 2 likes
  • 3 in conversation