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;
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
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;
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
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
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →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.