Hi All, I am looking for a way to make time groups from datetime values. Further I have to summarize observations in these groups (time intervals). The result must be like this: Date, time Interval time 2017.10.25 6:40 6:00-7:00 2017.10.25 8:11 8:00-9:00 2017.10.25 10:27 10:00-11:00 2017.10.25 11:06 11:00-12:00 2017.10.25 12:53 12:00-13:00 2017.10.25 13:20 13:00-14:00 I tried this code: data want;
set have;
interval=cats(put(hour(Date_time),2.),':00-',put(hour(Date_time)+1,2.),':00');
run; It looks like this is very good for me but I don't know this is an appropriate solution or not. I am a very beginner SAS programmer. Thank you for your answers.
... View more