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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 1254 views
  • 2 likes
  • 2 in conversation