Hello.
I have a SAS file called Prg_grp. One of the variables in this file is called "outcomes" coded as 0,1,2 or 3.
1 in the outcome denotes = asthin
2 = Coap
3 = Soca
However any of my outcome that is not either of the above is denoted = 0.
I have 11, 829,526 of observations but my total number based on ID without duplications is 85,000.
My file has other variables such as ID, medic, medic_date.
I want to remove duplicates so that only an ID has either 1, 2, or 3 and the total number of rows corresponding to my ID is exactly 85,000.
Hi,
Why not an IF condition to only keep the records you need.
data want;
set have;
if outcomes in (1,2,3);
run;
Thank you.
however, i will still get duplicates because, those codes in medic variable which are not 1, 2, 3 will still be available in medic variable. So those observations will still be present in medic.
Running a proc freq on outcome variable will yield those values not coded 1,2 or 3 as missing.
Also the outcome variables of 1, 2 or 3 are based on a single code in medic or combination of codes.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.