Hi All, In my dataset, I want to retrieve only those records where emp joining time (hh:mm) > relieve time (hh:mm)
e.g I am not sure how to import dates into emp dataset. Please check.
data emp;
input id join relieve;
cards;
101 2022-11-24T09:21:04 2022-11-24T11:24:14
102 2022-12-09T07:19:10 2022-12-09T05:19:10
;
run;
data emp1;
set emp;
join1= substr(join,12,5);
jointime = timepart( intnx('dthour',input(join1,time5.),0,'same'));
relieve1= substr(relieve,12,5);
relievetime = timepart( intnx('dthour',input(relieve1,time5.),0,'same'));
format jointime relievetime time5.;
run;
data final;
set emp1;
where jointime>relievetime;
run;
... View more