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;
Ready to join fellow brilliant minds for the SAS Hackathon?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.