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 (October 2004, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 14 Oct 2004 07:33:11 -0400
Reply-To:     "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Subject:      Re: SAS datastep-looping problem
Comments: To: Jesper Sahner Pedersen <jespersahner@HOTMAIL.COM>

On Thu, 14 Oct 2004 01:49:12 -0700, Jesper Sahner <jespersahner@HOTMAIL.COM> wrote:

>Hi! > >Just a little teaser :-) > >Try the following: > >data test; >do until (last); > set sashelp.prdsale end=last; >end; >output; >run; > >No problem. Now try this: > >data test2; >retain first 1; >if first then do; > first=0; > do until (last); > set sashelp.prdsale end=last; > end; >end; >output; >run; > >This doesn't work. What is the EXACT explanation?

Hi, Jesper,

I recommend Ian Whitlock's paper on SAS Supervisor (one version is found at http://www.dc-sug.org/super3.pdf). In one place in the paper, he asks an rhetorical question:

Perhaps the first question to ask is, "What stops the [data step] looping process and where does it stop?"

Answers found in the paper. :-)

Cheers, Chang


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