As everybody here is still forced to make guesses about your existing data and the data you want (which obviously makes it hard to come up with a working solution), you now MUST post usable example data and the wanted result from that if you expect answers that make sense. PLEASE help us to help you.
Yes. As others said there are too many things uncertain. If I understood what you meant.
data have; infile cards truncover expandtabs; input date :date. meal :$10. start :time. stop :time. value; format date yymmdd10. start stop tod8.; cards; 02-Jun-25 Sick 16:00:00 16:45:00 465 02-Jun-25 Meal 16:45:00 17:15:00 30 ; data gt30m le30m; set have; if intck('minutes',start,stop)>30 then output gt30m; else output le30m; run; data temp_gt30m; set gt30m; mystart=start; do i=start to stop; if i-mystart=1800 or i=stop then do;myend=i;output;mystart=i; end; end; drop i; format mystart myend tod8.; run; data temp_le30m; set le30m; mystart=start; interval=(stop-start)/2; do i=start to stop; if i-mystart=interval or i=stop then do;myend=i;output;mystart=i; end; end; drop interval i; format mystart myend tod8.; run; data want; set temp_:; run;
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!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.