You can use first.variable/last.variable to flag duplicate records. Depending on the VISIT values, you can consider sorting order (eg. subjectid date time descending visit)
Eg:
data have;
input subjectid $ visit $ date:date9. time:time5.;
format date date9. time time5.;
cards;
101 Screen 30Jan2020 11:15
101 Day1 30Jan2020 11:15
101 Week6 15Mar2020 12:15
101 Week12 01May2020 12:00
;
proc print;run;
proc sort data=have;
by subjectid date time descending visit;
run;
data want;
set have;
by subjectid date time;
length flag $20;
if not first.time then flag= 'duplicate date';
proc print;run;
... View more