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 (May 2010, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 7 May 2010 17:14:12 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Stupid Human Do-Loop Trick
Comments: To: Paul St Louis <>, Ron Fehd <>,
          "sarah (Personal) Woodruff" <>
Content-Type: text/plain; charset="iso-8859-1"

As I was sitting here bored since my the two quad core processors in my head have been working overtime lately. So while working on a SAS paper I decided to play around a bit and discovered the following:

How to make a do loop go forward and backwards in the same call to the do loop:

Data _NULL_ ;

Do I = 1 , 2 , 3 To 1 By -1 ; Put I= ; End ;

Run ;

I=1 I=2 I=3 I=2 I=1

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

_________________________________________________________________ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail.

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