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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 1583 views
  • 2 likes
  • 3 in conversation