[code:11k9zi4d]data test1;
input a b;
cards;
0.1 0.03
0.2 0.04
0.4 0.08
0.5 0.24
0.7 0.51
;
run;
data _null_;
set test1 end=last;
if last then call symput('n',a);
run;
data test2;
do _n_=1 to &n*10;
a=_n_/10;
b=.;
c=a**2;
output;
end;
run;
data result;
update test1 test2;
by a;
run;[/code:11k9zi4d]
data test;
input a b;
cards;
0.1 0.03
0.2 0.04
0.4 0.08
0.5 0.24
0.7 0.51
;
run;
%let d=0.1;
data result(drop=x y tmp i);
set test1;
x=lag(a);
y=dif(a);
if _n_=1 then do;x=a-&d;y=&d;end;
if y=&d then do;c=a**2;output;end;
else do;
tmp=b;
do i=x+&d to x+y by &d;
a=i;
c=a**2;
if a^=(x+y) then b=.;
else b=tmp;
output;
end;
end;
run;
[/code:1kdznden]