Date: Thu, 29 Jan 2004 12:12:18 -0700
Reply-To: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Subject: Re: Leaving Do loop in %Do
Content-Type: text/plain; charset=iso-8859-1
>Your %do statement is open when you do this. Be careful with the nested loops.
could you explain this ?
Under what circumstances will the code below cause a problem? The documentation warns against branching into the middle of a loop, but not against branching out.
Manager, Technical Development
Metrics Department, First Health
West Sacramento, California USA
>>> "SUBSCRIBE SAS-L Stephane" <datametric@CLUB-INTERNET.FR> 01/29/2004 9:28 AM >>>
Your %do statement is open when you do this. Be careful with the nested loops.
>Date: Wed, 28 Jan 2004 23:54:39 -0700
>De: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
>Sujet: Re: Leaving Do loop in %Do
>Use a %GOTO to a label immediately after the loop
> %do i = 1 %to 12;
> %if &i = 4 %then %goto exitloop;
> 1 2 3
>Gotos can lead to trouble, and so their use should be restricted to
>cases like this one.
>Manager, Technical Development
>Metrics Department, First Health
>West Sacramento, California USA
>>>> "taran gujral" <taran_jit@YAHOO.COM> 01/28/2004 8:34 PM >>>
>hello folks ,
>i wanted to know how we could leave a %do loop as
>we leave Do loop with a leave .
>Do i =1 to 5;
>if i = 4 then leave;
>what can i use if i have %do loop
>Chat instantly with your online friends?
>Get the FREE Yahoo!Messenger