Agree, probably not too difficult, point is, the algorithm in section 2 is expected to be very frequently used maybe SAS should consider adding this utility? (or at least this could be a great The Do Loop next topic?)