BookmarkSubscribeRSS Feed
Pooja98
Fluorite | Level 6

Hi Experts,

 

i came across the situation, where I'm not able to solve this?

 

For example,

 

date           test        result          count of patient

04-11-20   Blood     Positive        20

05-11-20   Urine     Positive        56

04-11-20   Urine     Negative       2

06-11-20   Urine     Positive         7

05-11-20   Blood     Negative      5

06-09-20   Blood    Negative       52

 

My criteria is i need urine test only, to get the count of patient (both positive & negative)

like for urine test, total 65

 

please help me to resolve this situation. i have the data set of 20000 obs.

 

thanks in advance

1 REPLY 1
Reeza
Super User

This is the input data?

If so, assuming your data set name is HAVE and "count of patient" is PATIENT_COUNT. 

 

proc freq data=HAVE;
where test="Urine";
table result / out=summary_urine;
weight patient_count;
run;

@Pooja98 wrote:

Hi Experts,

 

i came across the situation, where I'm not able to solve this?

 

For example,

 

date           test        result          count of patient

04-11-20   Blood     Positive        20

05-11-20   Urine     Positive        56

04-11-20   Urine     Negative       2

06-11-20   Urine     Positive         7

05-11-20   Blood     Negative      5

06-09-20   Blood    Negative       52

 

My criteria is i need urine test only, to get the count of patient (both positive & negative)

like for urine test, total 65

 

please help me to resolve this situation. i have the data set of 20000 obs.

 

thanks in advance


 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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
  • 1 reply
  • 392 views
  • 0 likes
  • 2 in conversation