from the general descriptions of this problem, it seems that each person is to be attributed the lowest common denominator (LCD) of GROUP the pseudo code for a data step would go along the lines for each person save the first group as common get the LCD between this group and common as new common on completion of reviewing groups for a person, output common for that person To decide which dominates, we need two inputs, not just one. So it looks like it needs a square matrix to say who "dominates" For this hierarchy 10 > 16 16 > 22 13 > 11 11 > 14 22 > 17 the relationships are more complex, and probably still simpler than the real situation The matrix would be (i think) __ 10 11 13 14 16 17 22 10 10 ?? ?? ?? 10 10 10 11 ?? 11 13 11 ?? ?? ?? 13 ?? 13 13 13 ?? ?? ?? 14 ?? 11 13 14 ?? ?? ?? 16 10 ?? ?? ?? 16 16 16 17 10 ?? ?? ?? 16 17 22 22 10 ?? ?? ?? 16 22 22 In building this matrix, the domination pairs have been extended for example 10>16>22>17, so 10>22 and 16>17 As it has been reduced to specific pairs, either an array or a format look-up could be used to make the decision when processing through the GROUPs. If the values of GROUP are simple integers and of not too great a range, the matrix would execute fastest, using the numeric values of GROUP as the array indexes. For example: data ; array dominat( &size:&size ) _temporary_ ( &matrix_values_list) ; * size is the number range of GROUP and matrix_values_list provides the dominating value for the pair ; set data ; by person ; if first.person then common = group ; else common = dominat( common, group ) ; if last.person ; run ; That leaves the ?? challenge. Perhaps it should have value 99 and that always dominates. So add a 99 column and row __ 10 11 13 14 16 17 22 99 99 99 99 99 99 99 99 99 99 The final challenge is to load those values in &matrix_values_list. An automated system would be needed to check through the hierarchy only if it is too large or complex for the manual process. So, McZ, how complex are these GROUPs and their inter-relationships? hth peterC
... View more