How to iterate through possible matches

I have to match a persons score with a list. The scores can look like AA111, starts with AA and then 3 numbers from 0-9.

The lists to match the score looks like this:
AA00*-AA14* = grade1 (* means any number 0-9 is acceptable)
AA43*-AA44* = grade2
AA50* = grade3

Person1 has the score AA123 which equals grade1
Person2 has the score AA430 which equals grade2
Person3 has the score AA509 which equals grade3

Anyone have any suggestions on how to approach this task?

Solved it by sorting the data in SAS