@tan-wongv wrote:
Thank you so much for your help!
Could you also please help me with the code if I want to generate t1 t2 t3 and t4?
The outcome would be:
DMRN |
t1 |
t2 |
t3 |
t4 |
31 |
09MAY2017 |
30MAY2017 |
06APR2018 |
07FEB2019 |
33 |
02JUN2017 |
04DEC2017 |
11JUN2018 |
. |
This would do the basic reshaping of the data if the data is at least grouped by DMRN:
proc transpose data=have
out=want (drop=_name_)
prefix=t
;
by dmrn notsorted;
var dx_date;
run;
You would have to describe the logic why DRMN=32 is not in your want set and apply that logic to the Want to remove it (I might guess if the number of T variables with not missing values (function N) is greater than 1.