This maybe overly simple but I am stuck...
My data is like this:
| ID | Series | S_Days | P_days |
| 1 | 1 | 1_30 | 150_200 |
| 2 | 5 | 1_30 | 150_200 |
| 3 | 5 | 1_30 | 150_200 |
| 4 | 1 | 91_120 | NP |
| 5 | 5 | 61_90 | NP |
| 6 | 5 | 61_90 | 0_30 |
I need to count the number of ID's where P_days = NP and does not equal NP and group it by Series and S Days
I wrote the following but it's not working...
proc sql;
create table test as
select Series ,s_days
(case when p_days = 'NP' then count(ban) end) as NP,
(case when p_days ^= 'NP' then count(ban) end) as Pay
from Master
group by Series, S_days
;
quit;
would really appreciate any suggestions. Thank you.
I figured it out 🙂
count(case when (p_days ='NP') then ban end) as NP
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.