You need a combination of variables that uniquely identify the observations to use PROC TRANSPOSE. You could always just run an extra data step to create one first.
data DB;
input (ID Start End TypeTransfusion1-TypeTransfusion3) (:$20.);
cards;
0001 2024-09-01 2024-10-01 RBC Whole blood .
0001 2024-09-01 2024-10-01 . . Platelet
0002 2016-NK-NK 2016-NK-NK . Whole blood Platelet
0002 2016-05-02 2016-05-02 RBC Whole blood .
0002 2016-05-05 2016-05-04 . . Platelet
0003 . . . . .
0003 . . . . .
0004 2024-09-01 2024-10-01 RBC Whole blood .
0004 2024-09-01 2024-10-01 . . Platelet
0005 2025-11-03 2025-11-23 . Whole blood .
0005 2025-11-03 2025-11-14 RBC . .
;
data for_transpose;
row+1;
set db;
run;
proc transpose data=for_transpose out=want(rename=(col1=TypeTransfusion));
by row id start end;
var TypeTransfusion1-TypeTransfusion3;
run;
Or just don't bother with using PROC TRANSPOSE and instead just write the data step to transpose the data yourself.
data want2;
set db;
length TypeTransfusion $20;
array list TypeTransfusion1-TypeTransfusion3 ;
do index=1 to dim(list);
TypeTransfusion=list[index];
output;
end;
drop TypeTransfusion1-TypeTransfusion3;
run;
You might want to add logic to eliminate the empty values.