Hello,
Anyone can help much appreciated. How can I know whether if a duplicate of my sub_IDs that they are not the same. Example
DATA have;
INPUT
sub_id : $6.
gender : $1.
dob : DATE9.
race : $1.
education : $1.;
FORMAT dob DATE9.;
LABEL
sub_id = "id of a subject"
gender = "gender"
dob = "dob"
race = "race"
education = "level od education" ;
DATALINES;
002039 F 27mar1971 1 G
001204 M 12jan1972 1 H
005023 M 15jun1969 2 C
003025 M 17apr1968 2 G
001204 M 23feb1972 1 H
003029 F 30dec1970 1 G
001106 F 25oct1973 2 C
002034 M 31jan1962 3 H
005003 M 15jun1969 2 C
001204 M 01jan1972 1 H
006101 F 08jul1970 2 C
;
proc print data = have;
run;
What's your expected output from this data? I'm assuming that's sample input data.
@PhanS wrote:
Hello,
Anyone can help much appreciated. How can I know whether if a duplicate of my sub_IDs that they are not the same. Example
DATA have; INPUT sub_id : $6. gender : $1. dob : DATE9. race : $1. education : $1.; FORMAT dob DATE9.; LABEL sub_id = "id of a subject" gender = "gender" dob = "dob" race = "race" education = "level od education" ; DATALINES; 002039 F 27mar1971 1 G 001204 M 12jan1972 1 H 005023 M 15jun1969 2 C 003025 M 17apr1968 2 G 001204 M 23feb1972 1 H 003029 F 30dec1970 1 G 001106 F 25oct1973 2 C 002034 M 31jan1962 3 H 005003 M 15jun1969 2 C 001204 M 01jan1972 1 H 006101 F 08jul1970 2 C ; proc print data = have; run;
I want to identify if there are duplicates among subjects. Sub_IDs 005023 and 005003 are identical. I want to find these two subjects.
Look at PROC SORT with the DUPOUT or NOUNIQUERECS options.
Use the other variables, not ID, in your BY statement.
Thank you. I will try.
Phan S.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.