Here's another example. If you run this code, it quits after just over 1000 iterations, even though theoretically smallnum should never become zero. It's quite possible that the result that is causing you problems is actually zero. All of the preceding advice is correct; you should consider ways to restructure your code. Tom data nums; smallnum = 1; stopflag = 0; do i = 1 to 1000000 while(stopflag = 0); smallnum = smallnum / 2; testnum = 1 / smallnum; output; if smallnum = 0 then stopflag = 1; end; run;
... View more