LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (April 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 15 Apr 2007 22:25:04 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: Repeat running one macro multiple times.
Comments: To: gerhard.hellriegel@T-ONLINE.DE
Comments: cc: aijingaustin@GMAIL.COM
In-Reply-To:  <200704151922.l3FAkWfU008856@mailgw.cc.uga.edu>
Content-Type: text/plain; format=flowed

Or better yet just do it in a Data _Null_ and forget about the Macro wrapper.

Data _Null_ ; Call Execute( Repeat( '%Test' , 10 ) ) ; Run ;

Toby Dunn

You can see a lot by just looking. ~Yogi Berra

Do not seek to follow in the footsteps of the wise. Seek what they sought. ~Matsuo Basho

You never know what is enough, until you know what is more than enough. ~William Blake, Proverbs of Hell

From: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE> Reply-To: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE> To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Repeat running one macro multiple times. Date: Sun, 15 Apr 2007 15:22:39 -0400

Thats simple: use

%do i=1 %to 10; .....

What would be even better:

%macro repeat(reps); %do i=1 %to &reps; %test; %end; %mend; %repeat(10);

Gerhard

On Sun, 15 Apr 2007 10:39:58 -0400, Howard Schreier <hs AT dc-sug DOT org> <nospam@HOWLES.COM> wrote:

>On Sun, 15 Apr 2007 01:01:58 -0400, Jing <aijingaustin@GMAIL.COM> wrote: > >>Hi, there, >> >>I have a very simple question to ask regarding macro. I have written a >>macro,say,%test. And I want to repeat running this macro multiple times >>(say, 10 times). I think in that case, I need to write a higher level >>macro, say %repeat, to do this repetition. I figured the general form is >>like: >> %macro repeat; >> %do ?; >> %test; >> %end; >> %mend repeat; >> %repeat; >> run; >>However, I am not sure how I can fill in the "?" after "%do" in order to >>execute %test 10 times. Can anyone help me with that? > >Look at the documentation for the %DO statement. > >> >>Thank you very much! >> >>Best, >>Jing

_________________________________________________________________ Need a break? Find your escape route with Live Search Maps. http://maps.live.com/?icid=hmtag3


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