Use call sort() to sort the teams per observation, and then proc summary to get the count:
data head_count;
input team1 $ team2 $;
datalines;
IND AUS
AUS IND
NZ IND
IND NZ
PAK IND
WI PAK
PAK AUS
;
data sorted;
set head_count;
call sort(of team:);
run;
proc summary data=sorted nway;
class team1 team2;
output out=want (drop=_type_ rename=(_freq_=count));
run;
Use call sort() to sort the teams per observation, and then proc summary to get the count:
data head_count;
input team1 $ team2 $;
datalines;
IND AUS
AUS IND
NZ IND
IND NZ
PAK IND
WI PAK
PAK AUS
;
data sorted;
set head_count;
call sort(of team:);
run;
proc summary data=sorted nway;
class team1 team2;
output out=want (drop=_type_ rename=(_freq_=count));
run;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!