I would also go with Scott's suggestion.
You just need to retain the previous SALES date/time and subtract it to the next element on the group (ID). Then reset the retained value to 9:00am.
Like this:
[pre]
data OUTDATA;
length ELAPSED 8;
format ELAPSED mmss5.;
set INDATA;
by ID; * assume INDATA is sorted by ID;
drop _:;
retain _AUX 8; * retain auxiliary var;
if first.ID then _AUX=dhms(datepart(DATE),9,0,0); * reset auxiliary var;
ELAPSED=DATE-_AUX; * calculate elapsed time;
_AUX=DATE; * store current time for next iteration;
run;
[/pre]
Cheers from Portugal.
Daniel Santos @
www.cgd.pt