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.
Catch up on SAS Innovate 2026
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.