I have some variables I need to count given some conditions are satisfied and my current code isn't working as intended. I have around 50 variables, so I'd hate to have to type the names for all of them, but here is what I need to happen:
If the variable contains a value of 0 or it's missing, don't count it. Otherwise it gets counted. Here is my code that isn't working correctly:
DATA CaresEndor; SET CaresSums;
IF (cares_sf_1-cares_sf_7) ne 0 then PhysEndor = n(of cares_sf_1-cares_sf_7);
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.