Have you got instructions how to create the output? what are the rules ?
I suppose that if data on both datasets is the same then remark="OK";
else remark="NOTOK";
To achieve that use merge statement:
data want(drop=_name);
merge have(in=in1)
have2(in=in2 rename=(name=_name));
by ID;
if in1 and in2 and name=_name then remark='ok';
else if in1 and in2 then remark = 'notok';
else delete;
run;