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

Hi everyone, I've got three variables  "a","b","c", I would like to create a list of all possible combinations with these three variables which can be duplicate.The order doesn't matter. It's like factorial problem in high school. eg. 3!=27. The result should be like the following table.I'm really appreciate it if someone can help. Thanks.

 

seqPlayer1Player2Player3
01aaa
02aab
03aac
04aba
05abb
06abc
07aca
08acb
09acc
10baa
11bab
12bac
13bba
14bbb
15bbc
16bca
17bcb
18bcc
19caa
20cab
21cac
22cba
23cbb
24cbc
25cca
26ccb
27ccc
1 ACCEPTED SOLUTION

Accepted Solutions
ABritinAus
Obsidian | Level 7
data temp;
  do player1='a','b','c';
    do player2='a','b','c';
	do player3='a','b','c';
	 output;
	 end;
	end;
  end;
run;

Hi.

 

Does this do what you are asking for?

View solution in original post

5 REPLIES 5
ABritinAus
Obsidian | Level 7
data temp;
  do player1='a','b','c';
    do player2='a','b','c';
	do player3='a','b','c';
	 output;
	 end;
	end;
  end;
run;

Hi.

 

Does this do what you are asking for?

EC189QRW
Obsidian | Level 7

Problem solved in a light speed. Thanks!

Reeza
Super User
What's LOL about the question?
EC189QRW
Obsidian | Level 7

It took me more than 10 minutes to figure it out. I was questioning about myself. Thank you for your reply.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 5 replies
  • 1418 views
  • 2 likes
  • 3 in conversation