I agree with Patrick's approach but, as many of us have at some time, he apparently responded before drinking enough coffee!
In his example, make sure that the first file is called have, not want and don't drop Patient_ID.
Plus, I don't know if IFC is any more efficient than a combination of if then statements, but I prefer it. E.g.,
data have;
input Patient_ID Result $;
datalines;
123 Z100
123 A100
124 B100
124 Z100
127 H119
127 J112
127 Z100
;
run;
data want;
set have;
by Patient_ID;
retain result_arr;
length result_arr $ 1000;
result_arr=ifc( first.patient_id,result,
cats(result_arr,',',result));
if last.patient_id then output;
run;
HTH,
Art