Date: Thu, 29 Mar 2012 12:02:21 -0400
Reply-To: SUBSCRIBE SAS-L JingJu11 S <jingju11@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: SUBSCRIBE SAS-L JingJu11 S <jingju11@HOTMAIL.COM>
Subject: Re: Help with a Transposition
except for easy understanding syntax, nothing to mention for my code:
%macro trans(s,var);
proc transpose data=have out=&var. suffix=&s.;
id measure;
by id year;
var &var.;
%mend trans;
data _null_;
set have(obs=1);
array n[*] MeasureNumerator-numeric-MeasureScore;
length tot $320.;
do i=1 to dim(n);
tot=catx(' ', tot, vname(n[i]));
call execute('%trans('||substrn(vname(n[i]),8,3)
||','||vname(n[i])||')');
end;
call symputx('tot', tot);
%nrstr(call execute('data final; drop _name_; merge &tot.; run;'));
run;
|