Hmmm... You just have about a millions ways to do this with SAS.
Anyway, It's just a simple grouping case, I wouldn't call it a complex problem.
But for the resulting table:
A B D E
05-06-2009 1 20 20=
<30
06-06-2009 1 40 x=>40
07-06-2009 1 20 20=<30
05-06-2009 2 20 20=<30
06-06-2009 2 150 x=>40
07-06-2009 2 10 10=<20
07-06-2009 3 30 30=<40
08-06-2009 3 30 30=<40
I understand that E would be the range for the group (each day), and what about D?
And also which B should be chosen for each group?
Just for A and E, try this:
proc sql noprint;
create table RESULT as
select A, min(C) as MINC, max(C) as MAXC from LIB.DATA;
quit;
This will give you for each day, and the minimum and maximum values of C (range).
Cheers from Portugal.
Daniel Santos @ www.cgd.pt.