Use a double TRANSPOSE:
data have;
infile datalines dsd truncover;
n = _N_;
input a1 a2 a3 a4 a5 b1 b2 b3 b4 b5 c1 c2 c3 c4 c5;
datalines;
1,2,,,,3,44,,,,22
,,,,,1
2,,,,,22
;
proc transpose data=have out=long (drop=_name_ where=(col1 ne .));
by n;
var a: b: c:;
run;
proc transpose data=long out=want (drop=_name_) prefix=abc;
by n;
var col1;
run;
Please provide example data in the future like this (DATA step with DATALINES), so we don't have to do it for you.
I have a strong suspicion that your original data is not in this wide form; if yes, please show us an example. This might make it much easier to get your result, which looks more like a report than a dataset.
... View more