Hi Nicholas, I just posted a hash table solution that could accomodate your need, at least if I understand properly, in the following thread https://communities.sas.com/message/176069#176069 Obviously, some tweaks would need to be made. data _null_; if _n_=1 then do; declare hash h(); h.defineKey('name'); h.defineData('name', 'points'); h.defineDone; end; set have; array round {*} round_1-round_7; /* This effectively allows us to use loops on the 7 rounds rather than hard code them */ do i=1 to 7; if trim(round{i}) NE "*" then do; win1 = scan(round{i}, 1, "_"); win2 = scan(round{i}, 2, "_"); roundpoints = max(0, 10-order+1); rc=h.find(name: win1); if rc NE 0 then do; name=win1; points=roundpoints; h.add(); end; else do; points=points+roundpoints; h.replace(); end; rc=h.find(name: win2); if rc NE 0 then do; name=win2; points=roundpoints; h.add(); end; else do; points=points+roundpoints; h.replace(); end; end; end; rc=h.output(dataset: "work.want"); drop rc win1 win2 points; run; Here, you are using a hash object to add a new member each time a new name is encountered in the dataset initiating his "wins" value to 1. Afterwards, each time the same name shows in the DS, the 'wins' value is incremented by 1. The resulting data is stored in the hash object hence, the "want" data is output via the hash output method. This will create a dataset with columns 'name' and 'wins'. It is currently untested but the logic and syntax element is all there. Vincent *Edit* Reading Astounding's comment and going through the post you've linked, I believe I had misinterpreted your data. I believe the biggest question which we can't answer for you is how do you measure performance in each round. For instance, you could consider the sum of all orders for a given individual to be the best indicator of his performances (ascending). Or, similar to, say, F1 standings, you can attribute a score value per position and set everything below a certain position to 0 and then take the total score per round or the best score per round per individual etc. For the sake of providing a better code sample, I've updated the above code to output a dataset that "scores" each round as follow: Top 10 positions gives 10/9.../1 points resp. The sum of all points on all rounds gives the score of an individual. You can then simply sort the Want dataset by descending order to rank players from best to worst.
... View more