BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
FreelanceReinh
Jade | Level 19

It's even easier to get all combinations:

 

data all;
do x1=1 to 60;
  do x2=x1+1 to 60;
    do x3=x2+1 to 60;
      do x4=x3+1 to 60;
        do x5=x4+1 to 60;
          do x6=x5+1 to 60;
            output;
          end;
        end;
      end;
    end;
  end;
end;
run; /* Log: NOTE: The data set WORK.ALL has 50063860 observations and 6 variables. */

You may add a random number and sort by it (see the earlier post), if you don't like the lexicographic order.

FreelanceReinh
Jade | Level 19

It's exactly the number of possible combinations of 6 out of 60 (binomial coefficient).

 

If you need all, you wouldn't create random combinations, but just all, systematically.

FreelanceReinh
Jade | Level 19

Just a mathematical side note: The probability that the NODUPKEY sort step will have to eliminate any duplicates is less than 1 in 10000 (at least in theory). So, the probability that the algorithm fails because of more than 40 duplicates must be minuscule.

DartRodrigo
Lapis Lazuli | Level 10

That's the number of possibilities of a Raffle game. 

Smiley Happy

Reeza
Super User
Ok....so do you have a question?
DartRodrigo
Lapis Lazuli | Level 10

No Reeza,

Thanks again guys, amazing answers.

 

Thanks 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 20 replies
  • 1518 views
  • 10 likes
  • 3 in conversation