filename f_list pipe "dir D:\three\dat /b";
data mylist;
infile f_list;
input file :$14.;
run;
data mylist;
infile f_list;
input file :$14.;
run;
data mylist;
set mylist;
where file ? 'fit';
call symput('n',_n_);
put file _n_;
run;
set mylist;
where file ? 'fit';
call symput('n',_n_);
put file _n_;
run;
%macro getn;
data _null_;
set mylist;
%do i=1 %to &n.;
if _n_=&i. then call symput("fn&i.",file);
%end;
%mend;
data _null_;
set mylist;
%do i=1 %to &n.;
if _n_=&i. then call symput("fn&i.",file);
%end;
%mend;
%getn;
%macro inverse;
%do i=1 %to &n.;
data ex;
infile "D:\three\dat\%CMPRES(&&fn&i.)" firstobs=2 ;
input x y;
run;
ods listing close;
ods output ParameterEstimates = paras ;
proc nlin data=ex ;
parms a=100 b=100 c=100 t2a=10 t2b=10 t2c=10 e=10;
model y=a*exp(-x/t2a)+b*exp(-x/t2b)+c*exp(-x/t2c)+e;
run;
ods listing;
data inver (keep= name parameter estimate);
set paras;
name=scan("&&fn&i.",1);
run;
proc append base=inversx data=inver ;
run;
%end;
%mend;
set paras;
name=scan("&&fn&i.",1);
run;
proc append base=inversx data=inver ;
run;
%end;
%mend;
%inverse
proc sort data=inversx;
by name;
run;
proc transpose data=inversx out=final (drop=_name_);
var estimate ;
id parameter;
by name;
run;
proc print data=final ;
run;
求教程序解释。谢谢!



雷达卡



京公网安备 11010802022788号







