LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 26 Sep 2008 06:15:01 -0700
Reply-To:   Dirk Nachbar <dirknbr@GOOGLEMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Dirk Nachbar <dirknbr@GOOGLEMAIL.COM>
Organization:   http://groups.google.com
Subject:   Re: hi all, I to find prime number using Macro program and using base SAS.
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset=ISO-8859-1

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);


Back to: Top of message | Previous page | Main SAS-L page