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 2007, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 31 May 2007 09:39:00 -0400
Reply-To:   Matt Pettis <matt.pettis@THOMSON.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Matt Pettis <matt.pettis@THOMSON.COM>
Subject:   Re: Please give the explanation of this.....

The data step writes data to the dataset named on the 'data' line when either a) it encounters and executes an 'output' statement, or b) it hits the bottom of the datastep (which is the 'run' statement here).

both 'do' loops spin around inside of the datastep, incrementing x, WITHOUT encountering an 'output' statement. When the code finally hits the 'run' statement after executing 'x + 1' 60 times (or so -- i may have a 1-off error), it outputs that value of x. since there is no 'set' or 'infile' statement to make this step start executing for a second time, SAS stops.

That's how you get only one observation. Make sense?

Matt

On Thu, 31 May 2007 04:34:31 -0700, Naren <narendra.palmure@GMAIL.COM>

wrote:

>data work.sales; >do year = 1 to 5; >do month = 1 to 12; >x + 1; >end; >end; >run; >Which one of the following represents how many observations are >written to the WORK.SALES data set? >A. 0 >B. 1 >C. 5 >D. 60 >Answer: B > >Please give me the explanation of this problem...


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