proc transpose data=a out=b(drop=_NAME_) prefix=sbps;
by id;
var sbps;
run;[/code:860ad]作者: shiyiming 时间: 2005-8-11 13:54 标题: @ [code:64191]data b;
set a;
by id;
retain sbp1-sbp3;
array sbp[3];
if first.id then i=1;
sbp[i]=sbps;
i+1;
if last.id then output;
drop sbps time i;
run;[/code:64191]作者: shiyiming 时间: 2005-8-11 14:03 标题: @ [code:f30f6]data b;
retain id;
array u[*] sbp1-sbp3;
do i=1 to dim(u);
set a ;
u[i]=sbps;
end;
drop sbps time i;
run;[/code:f30f6]作者: shiyiming 时间: 2005-11-16 16:54 标题: 各位老大,这个又如何转? A:
proc sql;
create table result as
select * from a, b;
quit;
This works but I got a warning in the log:
WARNING: Variable code1 already exists on file WORK.RESULT.
Anybody knows why? I am not quite familar with proc sql.作者: shiyiming 时间: 2006-4-28 02:17 标题: Modify code for fixing warning ** Modify code for fixing warning **;
proc sql;
create table result as
select a.*, ret from a, b;
quit;作者: shiyiming 时间: 2007-8-1 13:08 标题: 精简的 data a;
label x1='601' x2='602' x3='603';
input date x1-x3 @@;
cards;
2001 2.1 1.2 3.5
2002 2.2 1.3 3.6
2003 2.3 1.4 3.7
;
run;
proc transpose data = a out = stat (rename = (_label_ = code col1 = prc) drop = _name_); by date; run;
proc sort; by code; run;