Greetings; I have data from a food intake monitoring system that records feeding behavior of animals. This data includes every time an animal entered the system, removed food and left the system. Thus, the system records very brief interruptions in food intake as different observation, but these eating bouts are actually part of the same meal. Therefore, I am attempting to conditionally collapse the data recorded as separate observations but that are actually part of the same meal (i.e., all observations that do not have at least 30 minutes between each eating event [a.k.a, IMI or intermeal interval]). I have placed the code that I have generated below. So far, when I run this code in SAS, the program gets hung-up in processing the data step; I have allowed SAS up to 8 hours to try and compute with no success and have to manually terminate. Thanks in advance for any assistance. The code that I have been working with so far is: data conditional; set ac.example_uncollapsed; /*This code simply refers to an earlier reference of the dataset that corresponds to the excel /*attachment in this post*/ sumintake = intake; IF IMI gt 1800 then DO; sumintake = 0; DO WHILE(IMI le 1800); BY StartTime notsorted EndTime notsorted IMI notsorted; StartTime = first.StartTime; EndTime = last.EndTime; sumintake + intake; IF last.EndTime then DO; output; END; END; END; meal_number +1; run;
... View more