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;