Your example data show 4 potential candidates for comparing the time when PredictiveAlarm=1. In the shown cases all of them would be within an hour but what if that were not the case? Would earliest, latest or some thing in between be used for the time comparison?
I would suggest creating a single SAS datetime valued variable instead of date and time since that will considerably simplify comparing times across midnight. It is not clear to me whether your date or time values are actually SAS date and Time values.
You should provide example data in the form of a data step as that resolves such questions. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the <> icon or attached as text to show exactly what you have and that we can test code against.
You didn't state it explicitly but I would assume that this has to be within each value for Ptid, correct?
And for a last question, what is the desired output appearance for the comparison?