Date: Thu, 14 Sep 2006 21:26:57 -0700
Reply-To: Flamingo <gsuxin@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Flamingo <gsuxin@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: First.var and last.var issue in by statement
In-Reply-To: <000101c6d82a$859b95b0$419e5680@hpdv1267ea>
Content-Type: text/plain; charset="iso-8859-1"
It definitely the same thing. you code delete the first element and
last element of the same group.
Nuno Soares wrote:
> Hi everyone,
>
> This is probably a really silly question, but I would like to be completely
> sure about the way SAS deals with the first.var and last.var in "by"
> statements.
> When we use the "by" statement, SAS creates 2 dummy variables first.var and
> last.var. My question is if we can refer to the variables in the following
> ways, ie, if the following code is identical:
>
> 1.
>
> Data table1; set table;
> By var1;
> If first.var1 then delete;
> If last.var1 then delete;
> Run;
>
> 2. Or
>
> Data table1; set table;
> By var1;
> If first.var1=1 then delete;
> If last.var1=1 then delete;
> Run;
>
> Best,
>
> Nuno
|