|
On Sep 26, 4:55 am, Satya <kondal4u...@gmail.com> wrote:
> hi all
> I to find prime number from 1 to 20 using Macro program and using
> base SAS.
> I tried but that code is some how big .
> Bye.
hi
here is ths solution
option mprint;
%macro prime(n);
data prime;
do i=1 to &n;
prime=1;
do j=2 to ceil(i/2);
if mod(i,j)=0 then prime=0;
end;
if prime=1 then output;
end;
run;
%mend;
%prime(20);
|