So, I tried using the above code- worked just as it should, thanks ballardw! I am trying to plan around and modify it now, which involves setting up all possible combinations of those cards. So, when it says: data possible; /* array p represents 3 cards held by player*/ array p $ p1-p3 ('05S','KH','QD'); /* and s for shared cards*/ array s $ s1-s5 ('03C','10S','JH','09D','02H'); array h $ h1-h5 ; /* the "hand" to evaluate*/ do pc= 1 to 3; /* how many of the players cards are used*/ I replaced the s array for all possible cards (52) and then used array p to see what combinations were possible. The problem I'm getting is that it says ALLPERM can't handle more than 20 variables- am I not specifying something correctly, or does this mean what it says it does? ERROR: The ALLPERM routine cannot permute more than 20 variables, but 52 variables were specified. If this is the case then it appears that my project is doomed, at least down this line of thought. But I am assuming I do not know enough about the function in general (probably an understatement), and was wondering if anyone has run into this error before? In case you want to see the code I am currently trying to run: data possible; /* array p represents 3 cards held by player*/ array p $ p1-p5 ('C02','S12','H14','D05','H08'); /* and s for shared cards*/ array s $ s1-s52 (&HANDS.); array h $ h1-h5 ; /* the "hand" to evaluate*/ do pc= 3 to 5; /* how many of the players cards are used*/ pcomb=comb(5,pc); /* determine number of combinations of players card to consider*/ do j= 1 to pcomb; /* make sure the "hand" is empty*/ call missing(of h ); /* Select a combination of size PC from the cards*/ call allcomb(j,pc, of p ); /* copy the selected player cards to the 'hand', the first PC number values are the selected ones*/ do m= 1 to pc; h = p ; end; /* combine with ALL combinations of the shared cards of size 5-pc*/ scomb=comb(52,52-pc); /* number of combinations from shared cards*/ do k=1 to scomb; call allcomb(k,52-pc, of s ); /* copy the selected SHARED cards to the 'hand'*/ do m= 1 to (5-pc); h[m+pc]= s[m+pc]; end; output; end; end; /* j loop*/ end; /* pc loop*/ run;
... View more