Hi,
I need help in flagging the ID's.
dataset1 dataset2
ID ID
1 1
2 3
3 5
4
5
I need to flag the identical ID's
in the above example I need to flag dataset1 which has same ID as dataset2. like ID's 1 3 5 needs to be flagged.
thanks in advance
data flaged;
merge dataset1(in=in1)
dataset2(in=in2);
by ID;
if in1;
if in2 then flag=1; else flag=0;
run;
View solution in original post
What does the output look like?
Is the data currently sorted by Id?
Are there duplicates of ID in either of the sets? If so which one(s)? And what would the output for duplicates look like?
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!
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.