I have a data set in SAS that I need to transpose. It has the form id date type value and I need to convert it into id date valueoftype1 valueoftype2 ...
Is there any
if first.date then a=.;b=.;c=.;d=.;
has to be replaced with:
if first.date then do;
a=.;b=.;c=.;d=.;
end;
or
if first.date then call missing(a,b,c,d);
Also instead of
if last.date then do; output; a=.;b=.;c=.;d=.; end;
now, it should be enough :
if last.date then output;
I guess a datastep will always be more efficient then PROC TRANSPOSE on big data. The limit is you have to find out of distinct values of the transposed variable and create new variables for those. I think that's the overhead of PROC TRANSPOSE - it first finds out the values. (I'm sorry I edited your own answer, so it might not be clear now what was the problem.)