Hi Rick, The following is amazingly inefficient but it can be done in one-line of IML! If the task is to find only a small number of primes, then why not multiply everything together (twice) and compare to the list of postive integers. It might even run faster than the sieve, but only if you have a max n of about 50 or less!

proc iml;
start primes_upto(n);
return(setdif( 2:n, t(2:int(n/2))*(2:int(n/2)) ));
finish;
print (primes_upto(200));
quit;