BookmarkSubscribeRSS Feed
Dhana18
Obsidian | Level 7

I have a data like this 

caseIncidentID Treatment_Date1colldate#VALUE!SpecimenTestTypeResult
Alert27732337732337/6/20177/6/20170.00UrethralCultureGC Positive
Alert27833947833947/17/20177/17/20170.00PharyngealCultureGC Positive
Alert27858787858788/1/20178/1/20170.00PharyngealCultureGC Positive
Alert297690697690611/27/201711/27/20170.00UrethralCultureGC Positive
Alert297691697691611/29/201711/29/20170.00EndocervicalCultureGC Positive
Alert297691697691611/29/201711/29/20170.00PharyngealCultureGC Positive
Alert297983097983011/29/201711/29/20170.00RectalCultureGC Positive
Alert297983097983011/29/201711/29/20170.00PharyngealCultureGC Positive
Alert300518200518212/12/201712/12/20170.00UrethralCultureGC Positive
Alert300518200518212/12/201712/12/20170.00RectalCultureGC Positive
Alert300518500518512/12/201712/12/20170.00RectalCultureGC Positive
Alert301076801076812/19/20171/3/2018-15.00UrethralCultureGC Positive
Alert301076801076812/19/20171/3/2018-15.00PharyngealCultureGC Positive
Alert301358801358812/15/201712/15/20170.00UrethralCultureGC Positive
Alert30594010594011/9/20181/9/20180.00UrethralCultureGC Positive
Alert31011751011752/22/20182/22/20180.00UrethralCultureGC Positive
Alert31011751011752/22/20182/22/20180.00RectalCultureGC Positive
Alert31094931094932/23/20182/23/20180.00EndocervicalCultureGC Positive
Alert31690271690274/27/20184/27/20180.00UrethralCultureGC Positive
Alert31900881900885/21/20185/23/2018-2.00UrethralCultureGC Positive
Alert32389192389197/24/20187/24/20180.00EndocervicalCultureGC Positive

i need to de-duplicate the incidence id and find out incidence ID with number of anatomic site of infection.

i want to see a table something like this;

idAnatomic site number of case
1Urethral20
2rectum5
3urethral & Rectum3
4endocervical and Pharyngeal4
5Throat6
6Cervix7

 

I have a presentation tomorrow Please HELP.

3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20

So you have six pre defined categories that you want to count the data by, correct?

 

Does this represent your actual problem? why is number of case = 20 for Anatomic Site=Urethral here? 

hashman
Ammonite | Level 13

@Dhana18:

If you want to be helped (let alone urgently), you must help those willing to help understand the nature of your task and exactly what output you'd like to generate given the sample input you provide. That would be the only way those willing to help would be able to understand what you need, as your verbal description of the task is so cloudy that (as you may have already seen) even the grand masters of discerning the gist of murky OP requirements fail to comprehend what you're trying to do. An output "table something like this", whose data have no apparent correlation with you input data sample, doesn't quite cut it.

 

Kind regard

Paul D.  

ballardw
Super User

My best guess comes to something like:

proc freq data=have order=freq;
   where result='GC Positive';
   tables Specimen /nopercent nocum;
run;

I can't tell if you need a data set or not or where the "ID" column values might come from. Perhaps send the output from proc freq above to a data set and then use proc print with the OBS="ID" option on the Print statement.

 

But you need to provide any rules involved if by "deduplicate" you mean to select a single record per incidentid.

 

I recognize some of the topic and I am constantly having to ask things about summaries by persons or positive tests or specimen sites. And if there are multiple positive specimen sites and only one is the be counted what hierarchy or rules are used to select them.

And for many reports we use total number of positive tests and total number of persons positive as it provides information related to the multiple positive results.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 410 views
  • 0 likes
  • 4 in conversation