Make sure the variable exists in your data set so that your BY statement is correct. You have a logical error so you need to modify your logic. Beyond that you need to show code.
The 2025 SAS Hackathon has begun!
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.