BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
HansSteenhuis
Calcite | Level 5

Hello,

 

Example of data:

 

IDBEGIN_TIMEEND_TIMEamount_of_minutes 
34913:0715:06 
34915:1715:5111
34916:0517:3114
34917:4318:4312
35114:5016:15 
35118:5719:38162
36712:0712:42 
36714:2016:2798
39011:3912:09 
39014:0315:35114
39018:4519:40190
39022:2623:23166

 

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

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;

View solution in original post

2 REPLIES 2
Ksharp
Super User

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;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1009 views
  • 2 likes
  • 2 in conversation