Tom, Thank you so much. That extra check if time < '12:00't corrected an issue I was running into was the time in seconds was greater then 86400. I will eventually be using the date and time together to get the difference but for now my lead just wants me to deal with time. I have my rows in the order they appear in the log file. sec tab var date time 1 1 1 01/01/2010 09:05:26 AM 1 1 1 01/01/2010 09:05:46 AM 1 1 2 01/01/2010 09:05:46 AM 1 1 2 01/01/2010 09:05:48 AM 1 1 1 01/01/2010 09:06:01 AM 1 1 1 01/01/2010 09:06:09 AM If I use the diff function it will do a minus from a current row from the previous row. Without sorting my data since I need the times to be in the correct order how can I get it to be. sec tab var diff 1 1 1 00:00:20 1 1 2 00:00:02 1 1 1 00:00:08 After this point I can go a sum in a proc sql and sum up total time spent on each combination sec tab var diff 1 1 1 00:00:28 1 1 2 00:00:02 Thank you again to everyone for your help
... View more