Hi SAS Users, I am not able to find the ID which has negative values within the BY group. Let me explain. My data looks like below: ID Value 100 1792 100 68193 100 -66173 100 1012 100 -366 101 -580 101 296 101 -37 102 13008 102 -205 102 2808 102 1185 So I want to identify all such ID's which, having one or more negative values within the BY group, then all should be within the range -1000 to -1. Here ID 100 has a value -366 but it also has -66173. So I dont want to select this. All the negative values within the BY group should be within the above limit. ID 101 has two negative values -580 & -37 and both lie in the limit so I will select ID 101. Also, for ID 102 it has only one negative value, -205. Hence I will select it as it lies in the given range. Further, I need to differentiate between the selected ID's which have one or more negative values within the limit. Count of negative values within the limit would be helpful.
... View more