Hello all, I have a data set which has start and stop times for hourly rates. Each subject has a rate for every hour, but since it was input as only when the rate changes and the time of change is variable, it is hard to standardize. I want to convert this into what the rate is at each hour so it is easier to compare the subjects and then pull out certain time blocks. I am having trouble doing this, I think bc I have never worked with time variables in SAS before. What I have: start_time_1 stop_time_1 rate_1 start_time_2 stop_time_2 rate_2 ...etc up to 12 What I want: rate000 rate100 rate200 ...etc for each hour of the day I started trying to figure out how to make it choose what rate to pick for each hour, but it stopped working at 200: Data work.rates; set work.rates; rate000 = rate_1; run; data WORK.rates; set WORK.rates; if start_time_2 > 1 then rate100 = rate_1; if start_time_2 <= 1 then rate100 = rate_2; data WORK.rates; set WORK.rates; if start_time_2 > 2 then rate200 = rate_1; if start_time_2 <= 2 then rate200 = rate_2; etc. Thank you in advance!
... View more