This issue is tricky so here goes:
I am working with complaint data. Each complaint is called a "case." Each case has a unique case number that never changes. Associated with the case number is a case type id that DOES change when the level of the complaint changes. Complaint levels are assigned based on the severity of the complaint and can go up or down. In other words if someone calls up with what seems like a major complaint but it is discovered while looking into the complaint that the complaint is really based on something very minor, the level of complaint will be ramped down. If, however, someone calls up with what seems like a minor complaint but it is discovered that there is really a major issue involved, the complaint type will be ramped up. Make sense? So, when cases change type, they are given a new "type ID." This type ID is usually a four-digit number. To really muddy the water, within each case, there can be multiple complaints. While all of these live under the same case number, they will each be assigned a different code identifying the general nature of the complaint. I am trying to calculate the total number of COMPLAINTS, not cases. The problem is that in my dataset, all of the type IDs come in. So I have type IDs that include those first assigned to a case as well as those last assigned to a case. I need to select just the highest number type IDs sitting under each case number. If this were SQL, I would use a MAX function (just return the MAX type ID for each case). Not sure how to do this in SAS. Please remember that the type ID is a one to many relationship so there could be, for example, four of the same type IDs in one case each associated with a different complaint. I sure hope this makes sense. Thanks in advance!
Message was edited by: coa125