%let N = 100;
data posints;
do n= 1 to &N.;
output;
end; proc print;
run;
how to get prime numbers
Hi @BrahmanandaRao,
Not surprisingly, this question has been discussed several times in the Communities. Here's one of those threads:
https://communities.sas.com/t5/SAS-Programming/Do-loop-and-mod-fuction/td-p/561261
Just implement the Sieve of Eratosthenes.
After almost 350 posts here, that should be an easy task for you.
Try it, and if your code does not work as expected, post it here.
Two good references with code:
https://blogs.sas.com/content/iml/2010/09/17/a-prime-number-sieve.html
https://listserv.uga.edu/cgi-bin/wa?A2=ind0001a&L=SAS-L&D=0&X=F7C9F4903B9FB285DA&Y=pnclemmensen%40gm... (requires login)
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.