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 (July 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 19 Jul 2010 07:26:42 -0400
Reply-To:     Søren Lassen <s.lassen@POST.TELE.DK>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Søren Lassen <s.lassen@POST.TELE.DK>
Subject:      Re: Bona fide DO-loop bug (was: Combining iterative DO and UNTIL
              condition)
Content-Type: text/plain; charset=ISO-8859-1

I do not agree with Toby on this one: > > So Do I = 1 , 2 , 3 Until( I = 2 ) , would mean it is only checked for > > the 3 and not the 1 or 2. Which means using the a hybrid Do iterative > > list and and a While|Until is pretty much worthless hunk of shit code. > > Which after a little testing seems to hold true. > > > > Toby Dunn

The list form may seem futile as presented, but what about

Do i=1 by 3 while(i<k),k to k by 5,i by -1 while(i>k);

in other words, you can use more than single items in the list, and you can apply while() and until() to all of them. Quite powerful!

Regards, Søren

On Sun, 18 Jul 2010 23:58:53 +0000, goladin@gmail.com <goladin@GMAIL.COM> wrote:

>I believe a SASopedia article will be most beneficial to us. More details tp help us understand the bug. > >Regards, >Murphy Choy >Sent from my Nokia phone >-----Original Message----- >From: toby dunn >Sent: 19/07/2010 7:46:57 AM >Subject: Re: Bona fide DO-loop bug (was: Re: Combining iterative DO and UNTIL condition) > >Already have something in mind Mark. > >Toby Dunn > >"Don't bail. The best gold is at the bottom of barrels of crap." >Randy Pausch > >"Be prepared. Luck is where preparation meets opportunity." >Randy Pausch > > > > >> From: mkeintz@wharton.upenn.edu >> To: tobydunn@HOTMAIL.COM; SAS-L@LISTSERV.UGA.EDU >> Subject: RE: Bona fide DO-loop bug (was: Re: Combining iterative DO and UNTIL condition) >> Date: Sun, 18 Jul 2010 23:40:50 +0000 >> >> Toby: >> >> This would be a good topic for you or someone else so inclined to add to the sas tip of the day in sascommunity.org. >> >> I am not so inclined, but I suggest the title "Don'ts for DO WHILE and DO UNTIL", or a more punchy "Don'ts for DO's" >> >> Regards, >> Mark >> >> > -----Original Message----- >> > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of >> > toby dunn >> > Sent: Sunday, July 18, 2010 6:54 PM >> > To: SAS-L@LISTSERV.UGA.EDU >> > Subject: Re: Bona fide DO-loop bug (was: Re: Combining iterative DO and >> > UNTIL condition) >> > >> > Paul, >> > >> > >> > >> > A little digging and I cam across this in the docs: >> > >> > >> > >> > A WHILE or UNTIL specification affects only the last item in the clause >> > in which it is located. >> > >> > >> > >> > So Do I = 1 , 2 , 3 Until( I = 2 ) , would mean it is only checked for >> > the 3 and not the 1 or 2. Which means using the a hybrid Do iterative >> > list and and a While|Until is pretty much worthless hunk of shit code. >> > Which after a little testing seems to hold true. >> > >> > Toby Dunn >> > >> > "Don't bail. The best gold is at the bottom of barrels of crap." >> > Randy Pausch >> > >> > "Be prepared. Luck is where preparation meets opportunity." >> > Randy Pausch >> > >> > >> > >> > >> > > Date: Sun, 18 Jul 2010 17:03:27 -0500 >> > > From: KevinMyers@AUSTIN.RR.COM >> > > Subject: Re: Bona fide DO-loop bug (was: Re: Combining iterative DO >> > and UNTIL condition) >> > > To: SAS-L@LISTSERV.UGA.EDU >> > > >> > > Toby, I think you may be missing the point on this one. It is >> > performing as >> > > designed/intended. The While/Until clause only applies to the >> > individual >> > > comma delimited portion of the DO loop indexes of which it is a part. >> > Each >> > > comma delimited portion of the DO loop index is treated in essence as >> > if it >> > > is controlling completely separate set of iterations for the DO loop. >> > You >> > > iterate over and exit from the first command delimited index clause >> > before >> > > moving on to the next comma delimited portion. >> > > >> > > s/KAM >> > > >> > > >> > > ----- Original Message ----- >> > > From: "toby dunn" <tobydunn@HOTMAIL.COM> >> > > To: <SAS-L@LISTSERV.UGA.EDU> >> > > Sent: Sunday, July 18, 2010 16:54 >> > > Subject: Re: Bona fide DO-loop bug (was: Re: Combining iterative DO >> > and >> > > UNTIL condition) >> > > >> > > >> > > Good point Data _Null_, I hadnt thought to add a value greater than 2 >> > as the >> > > first element. Seems the bug still holds true >> > > >> > > Toby Dunn >> > > >> > > "Don't bail. The best gold is at the bottom of barrels of crap." >> > > Randy Pausch >> > > >> > > "Be prepared. Luck is where preparation meets opportunity." >> > > Randy Pausch >> > > >> > > >> > > >> > > >> > > > Date: Sun, 18 Jul 2010 16:26:31 -0500 >> > > > Subject: Re: Bona fide DO-loop bug (was: Re: Combining iterative DO >> > and >> > > > UNTIL condition) >> > > > From: iebupdte@gmail.com >> > > > To: tobydunn@hotmail.com >> > > > CC: SAS-L@listserv.uga.edu >> > > > >> > > > On 7/18/10, toby dunn <tobydunn@hotmail.com> wrote: >> > > > > Especially in light of the fact that this does work as expected: >> > > > > data _null_ ; >> > > > > do x = 1, 2, 3 While (x < 3) ; >> > > > > put x= ; >> > > > > end ; >> > > > > Run ; >> > > > >> > > > I believe your example is flawed. >> > > > >> > > > 120 data _null_; >> > > > 121 do x = 4, 1, 2, 3 While (x < 3) ; >> > > > 122 put x=; >> > > > 123 end; >> > > > 124 run; >> > > > >> > > > x=4 >> > > > x=1 >> > > > x=2 >> > > > >> > > > You/we need to understand what the COMMA means and what syntax >> > > > elements it "delimites". >> > > >> > > _________________________________________________________________ >> > > Hotmail is redefining busy with tools for the New Busy. Get more from >> > your >> > > inbox. >> > > >> > http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL >> > :ON:WL:en-US:WM_HMP:042010_2= >> > >> > _________________________________________________________________ >> > Hotmail has tools for the New Busy. Search, chat and e-mail from your >> > inbox. >> > http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL >> > :ON:WL:en-US:WM_HMP:042010_1 > >_________________________________________________________________ >Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. >http://www.windowslive.com/campaign/thenewbusy? ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1


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