Date: Mon, 27 Dec 2010 17:04:25 -0800
Reply-To: Jack Hamilton <jfh@STANFORDALUMNI.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jack Hamilton <jfh@STANFORDALUMNI.ORG>
Subject: Re: last.id=1 or 0, how SAS supervisor knows about it?
Content-Type: text/plain; charset=us-ascii
Yes, the supervisor reads ahead one observation. There are a few places that the job log even reveals this, and they have been discussed in the past on SAS-L. Unfortunately, I don't remember what they are at the moment.
On Dec 27, 2010, at 3:06 PM, bbser 2009 wrote:
> Consider a simple code:
> data x;
> input ID $;
> data y;
> set x;
> by ID;
> There are three full iterations in the second DATA step, accordingly we have
> first.id last.id
> 1 0
> 0 1
> 1 1
> I am trying to understand why SAS supervisor knows when these values should
> be 1 or 0.
> It is quite easy to think about the values of first.id. But I confuse on the
> values of last.id.
> For example, in the first iteration of the second DATA step, ID="A" and
> How does SAS supervisor know this value of "A" is NOT the last value in the
> Only reason I could imagine was that while reading the first observation
> from data x the SAS supervisor already knew the next observation was still
> But, then again, how?
> Please help. Thanks.