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 <pstloui@dot.state.tx.us>, Ron Fehd <rjf2@cdc.gov>,
          "sarah (Personal) Woodruff" <sarahawoodruff@yahoo.com>
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. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5


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