Hi CurtisMack, what I intend is to capture all possible variations of aa bb cc dd ee ff in groups of 2, 3, 4, 5 and 6 which exists in my data to assign a group number. So far the hurdles are
1) Generates all permutations of these 6 words in a dataset like
Col1  Col2  Col3  Col4 ... Perm1     Perm2   Perm3    Perm4   Perm5    Perm6  ....
aa     bb                         aa,bb      bb,aa
aa     bb     cc                aa,bb,cc| aa,cc,bb|bb,aa,cc|bb,cc,aa|cc,aa,bb|cc,bb,aa
.
.
.
aa     bb     cc      dd
and concatenate all the Perm into one string which will be use in the IN("STRING")
data test;
set test;
if new_var in ("aa bb","bb aa") then number='01';
if new_var in ("aa bb cc","aa cc bb","bb aa cc","bb cc aa","cc aa bb","cc bb aa") then number='02';
and so on.
Hope this will clear up some confusion.
Thank you