hi SAS community
i would like to have a code to calculate the values in "duration". THe dataset contains multiple patient MRI studies (Patient name). Each MRI study contains a variable number of sequences (e.g a,b,c for patient 1, whereas a,b,c,d for patient 3). Time start is the time that each sequence starts. Duration is what I would like to calculate: which is calculated by subtracting the time start from the line below (after sorting the dataset in this order). Obviously the data will have be to grouped by the MRI studies, so the last sequence of any given study does not have duration calculated (thus left blank) as we do not have the end time of the study. Many thanks for your help in advance.
... View more