proc iml; /* begin IML session */ start approx(x); /* begin module */ y=1; /* initialize y */ do until(w<1e-3); /* begin do loop */ z=y; /* set z=y */ y=.5#(z+x/z); /* estimate square root */ w=abs(y-z); /* compute change in estimate */ end; /* end do loop */ return(y); /* return approximation */ finish approx; /* end module */ t=approx({3,5,7,9}); /* call function APPROX */ print t; /* print matrix */ quit;