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

 

 I want to group "AUS Vs WI" & "WI Vs AUS" 

data test;
infile datalines;
input Match $12.;
datalines;
AUS Vs WI
IND Vs SRI
AUS Vs WI
WI Vs AUS
IND Vs AUS
AUS Vs IND
SRI Vs IND
NZ Vs SA
SA Vs NZ
;
run;

proc print data=test;
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
data want;
set test;
team1 = scan(match, 1);
team2 = scan(match, 3);
call sortc(team1, team2);
run;

proc freq data=want;
table team1*team2 / list;
run;

@krishnaalla wrote:

i want to group the values :

example: 

AUS Vs IND  having 10 values

IND Vs AUS  having 15 values

 

 

treat as a similar value and group it as one value. 

 

in need

IND Vs AUS count as 25 values


 

View solution in original post

3 REPLIES 3
Reeza
Super User

What do you want as the output?

 


@krishnaalla wrote:

 

 I want to group "AUS Vs WI" & "WI Vs AUS" 

data test;
infile datalines;
input Match $12.;
datalines;
AUS Vs WI
IND Vs SRI
AUS Vs WI
WI Vs AUS
IND Vs AUS
AUS Vs IND
SRI Vs IND
NZ Vs SA
SA Vs NZ
;
run;

proc print data=test;
run;

 


 

krishnaalla
Fluorite | Level 6

i want to group the values :

example: 

AUS Vs IND  having 10 values

IND Vs AUS  having 15 values

 

 

treat as a similar value and group it as one value. 

 

in need

IND Vs AUS count as 25 values

Reeza
Super User
data want;
set test;
team1 = scan(match, 1);
team2 = scan(match, 3);
call sortc(team1, team2);
run;

proc freq data=want;
table team1*team2 / list;
run;

@krishnaalla wrote:

i want to group the values :

example: 

AUS Vs IND  having 10 values

IND Vs AUS  having 15 values

 

 

treat as a similar value and group it as one value. 

 

in need

IND Vs AUS count as 25 values


 

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 809 views
  • 2 likes
  • 2 in conversation