Gday, I would like to select unique matching pair from dataset. I post one dataset as example. DATA Have; INFILE Cards; INPUT X Y $ @@; CARDS; 1 A 2 A 3 A 4 A 5 B 6 B 7 B 8 B 1 B 2 B 3 B 4 B ; RUN; In dataset Have, x=1 can match with y=A or Y=B, as well as x=2. My goal is to select unique matching pair. I need to complete several steps: first, I select the pair of 1 and A and output to a new dataset, second, I need to exclude the pair having either 1 or A for the rest of dataset and update the orignial dataset then, after exlusion, I process to select the second pair in the update dataset, which should be the pair of 2 and B in this case. Ideally, the final dataset I need will include two pairs, 1 and A, 2and B. I tried different way, such DOW do-loop, link statement or sql subqury. All of them failed. I am open for any suggestions for this complex question. Thanks Lingshu
... View more