Date: Mon, 8 Nov 2010 23:32:09 -0700
Reply-To: Alan Churchill <alan.churchill@SAVIAN.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Alan Churchill <alan.churchill@SAVIAN.NET>
Subject: Re: what's wrong, only 5 observations
Content-Type: text/plain; charset="us-ascii"
I do not show the same results. I would double-check the original dataset
and make sure it doesn't have 5 observations.
What I believe is happening is that the do and end are essentially ignored.
I show the same number of obs coming out as going in.
SAS 9.2.
Alan
Alan Churchill
Savian
Work: 719-687-5954
Cell: 719-310-4870
-----Original Message-----
From: Nat Wooding [mailto:nathani@VERIZON.NET]
Sent: Monday, November 08, 2010 9:00 PM
Subject: Re: what's wrong, only 5 observations
Max
I am running the learning edition which means 9.1.3 and I do not have a
sasuser.actlevel file. So, I used SASHELP.AIR which has 144 obs. It appears
that the pointer that tells where to start reading in sashelp.air is not
reset after each increment of the loop so in the first loop, it reads 21 obs
and then in the next increment, 22 to 42 and so forth.
This is not what I would have expected but I do not often write code like
this so there are probably a lot of nuances that I have missed.
Nat Wooding
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
bbser2009
Sent: Monday, November 08, 2010 9:31 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: what's wrong, only 5 observations
I accidently wrote down a strange but grammatically right code like this:
data temp;
do i=1 to 42 by 2;
set sasuser.actlevel;
output;
end;
run;
proc print;
run;
The data set being read has 42 observations. I supposed the code gave me 21
observations.
But it turned out I only got the first 5 observations from the original data
set.
Could you help me explain this results. Thanks.
Max