Hi:
At first, for investigative purposes, this seems to be a simple counting problem that you could do with any number of procedures. I chose PROC TABULATE because it creates an automatic _TYPE_ variable in the output dataset that can be used to determine which of the CLASS variables contributed to the count. (look at the first PROC PRINT output -- it should become clearer what/how _TYPE_ can be used.)
If you look at the program below, there are 26 observations, each with a PERSON, XVAL and YVAL variables. Some folks have XVAL the same; some folks have YVAL the same and some folks have both values the same.
The PROC TABULATE step creates one output dataset with the counts for ALL XVALS, ALL YVALS and the combinations of XVAL and YVAL. The different PROC PRINTS show you ALL the obs in the output dataset versus just the XVALs GT 1, just the YVALs GT 1 and both the same GT 1.
cynthia
[pre]
data coord;
infile datalines;
input person $ xval yval;
return;
datalines;
alan 1 2
barb 1 3
carl 1 4
dave 2 5
edna 2 5
frank 2 6
georgia 2 6
harry 2 7
ida 3 2
jack 3 3
kathy 3 3
lewis 3 4
mary 3 5
norm 3 5
ophelia 4 3
peter 4 4
quentin 4 4
rose 4 5
steve 4 5
tara 4 6
umberto 4 7
victor 4 8
wilma 4 8
xavier 5 2
yarah 5 2
zack 5 3
;
run;
** Make an output dataset of the counts;
proc tabulate data=coord f=comma6. out=c_out(drop=_PAGE_ _TABLE_);
class xval yval;
table xval,n;
table yval,n;
table xval*yval,n;
run;
ods listing;
proc print data=c_out;
title "look at counts TYPE 10 is XVAL only, TYPE 01 is YVAL only";
title2 "and TYPE 11 is XVAL and YVAL";
run;
proc print data=c_out;
title 'Xvals with duplicates';
where _TYPE_ = '10' and N gt 1;
run;
proc print data=c_out;
title 'Yvals with duplicates';
where _TYPE_ = '01' and N gt 1;
run;
proc print data=c_out;
title 'Both Coords with duplicates';
where _TYPE_ = '11' and N gt 1;
run;
*** now that you have these values in a dataset, if you want to;
*** get the individual observations, you can go back and join;
*** these datasets with the original data to extract the folks;
*** who share coordinates.;
[/pre]