Sorry, without a clear cut example can't provide anything. What I would say is that what you are doing is called "binning" the data. There are numerous papers out there and several different methods. For example one way would be to normalise the data - i.e. instead of going across, have all the data going down, and then use something like proc rank:
http://documentation.sas.com/?docsetId=proc&docsetTarget=p0le3p5ngj1zlbn1mh3tistq9t76.htm&docsetVersion=9.4&locale=en
Or apply the logic yourself in a datastep.
... View more