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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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