I am trying to flag observations with the same ID and Date but different results. Not all observations with the same ID and Date will have a different result but a large fraction do. I have already created a flag variable for the observations with same ID and Date but having trouble creating the flag for different results.
Here is some example data.
data test;
input ID Dt :mmddyy10. result;
format dt mmddyy10.;
datalines;
1 4-27-24 1
1 4-27-24 1
1 4-30-24 2
1 4-30-24 2
2 5-5-24 1
2 5-5-24 2
3 6-6-24 1
3 6-6-24 1
4 7-7-24 1
4 7-7-24 2
4 7-17-24 2
4 7-17-24 2
;
run;
Thank you in advance!!