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;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 1107 views
  • 2 likes
  • 2 in conversation