mercredi 26 août 2020

Flagging Lines Below HHMM Threshold SAS IF/THEN Data Statement

I have a dataset where I calculated the number of total hours it took to process a request in hours. A request should be completed in 72 hours, or else if an extension is requested a request should be completed in 408 hours (14 days plus 72 hours).

I need to flag values with a Y or N depending if they meet these criteria.

My problem is that it is only recognizing negative HHMM values as below threshold, not a value like 29:15 which would represent 29 hours 15 minutes. This is less than 72 hours and should be marked "Y" indicating it is timely, but it is marking it "N".

This is what I tried so far:


data work.tbl_6;
set work.tbl_6;

if was_a_timeframe_extension_taken_ = "N" and time_to_notification <= 72 then notification_timely="Y";
else if was_a_timeframe_extension_taken_ = "Y" and time_to_notification <= 408 then notification_timely="Y";
else notification_timely="N";

run;

Can someone advise what could be going wrong here?

Aucun commentaire:

Enregistrer un commentaire