But NULL's code is not efficient when you have a big table , and you also need to re-order the variables. data status;
infile cards expandtabs;
input (ID Status)($) Parameter1 Parameter2 Parameter3;
cards;
10023 AFH2 2.1 50.1 30
10023 AFH1 3.3 78.2 77
;;;;
run;
proc sql;
select distinct 'status(where=(id="'||strip(id)||'" and status="'||strip(status)||'" )
rename=(Parameter1=Parameter1_'||strip(status)||'
Parameter2=Parameter2_'||strip(status)||'
Parameter3=Parameter3_'||strip(status)||'))' into : list separated by ' ' from status;
quit;
%put &list ;
data want;
merge &list ;
by id;
drop Status;
run;
Xia Keshan
... View more