Hello,
Example of data:
ID | BEGIN_TIME | END_TIME | amount_of_minutes |
349 | 13:07 | 15:06 | |
349 | 15:17 | 15:51 | 11 |
349 | 16:05 | 17:31 | 14 |
349 | 17:43 | 18:43 | 12 |
351 | 14:50 | 16:15 | |
351 | 18:57 | 19:38 | 162 |
367 | 12:07 | 12:42 | |
367 | 14:20 | 16:27 | 98 |
390 | 11:39 | 12:09 | |
390 | 14:03 | 15:35 | 114 |
390 | 18:45 | 19:40 | 190 |
390 | 22:26 | 23:23 | 166 |
is it possible to calculate the amount_of_minutes between the END_TIME and the BEGIN_TIME within the ID?
Thank you very much for any comments.
CODE NOT TEST.
data want;
set have;
by id;
amount_of_minutes =intck('minute',lag(END_TIME),BEGIN_TIME);
if first.id then call missing(amount_of_minutes );
run;
CODE NOT TEST.
data want;
set have;
by id;
amount_of_minutes =intck('minute',lag(END_TIME),BEGIN_TIME);
if first.id then call missing(amount_of_minutes );
run;
Thanks 🙂
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.