%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)
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.