BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Sandeep77
Lapis Lazuli | Level 10

Hello Experts,

I have a dataset which has month and three results in other column i.e., Pos, Neg and New. I want to find Pos, Neg and New result types in each month but I am not sure what is the correct way to approach this query. I can use case when to get results count monthly but I want count of different results in each month. Can you please help? Below is a sample data:

Month Acc_number Result
Other 10057292 POS
Apr-22 105181382 NEG
May-22 105464549 NEW
Jun-22 106517071 NEG
Other 107891210 NEG
Dec-22 112634274 POS
Feb-22 113570766 POS
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
proc freq data=have;
    tables month*result;
run;

 

 

Also, please provide data as working SAS data step code. I shouldn't have to ask repeatedly for this. https://communities.sas.com/t5/New-SAS-User/I-am-trying-to-find-accounts-looping-in-again-in-the-sam... 

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26
proc freq data=have;
    tables month*result;
run;

 

 

Also, please provide data as working SAS data step code. I shouldn't have to ask repeatedly for this. https://communities.sas.com/t5/New-SAS-User/I-am-trying-to-find-accounts-looping-in-again-in-the-sam... 

--
Paige Miller
Sandeep77
Lapis Lazuli | Level 10

Thank you!! It worked. I never used * before. So this was a new learning. Thanks again!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 257 views
  • 1 like
  • 2 in conversation