Date: Wed, 21 Sep 2005 06:59:22 -0700
Reply-To: frank_diiorio@YAHOO.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Frank DiIorio <frank_diiorio@YAHOO.COM>
Organization: http://groups.google.com
Subject: Re: Selecting last 10 rows from a dataset
In-Reply-To: <1127292530.019353.173880@o13g2000cwo.googlegroups.com>
Content-Type: text/plain; charset="iso-8859-1"
Ali has already shown this is a one-step solution. What I'd add to his
code is a check to ensure that the program correctly handles cases
where the input dataset has fewer than 10 observations. This is shown
below:
data b;
do i = n-9 to n;
if i > 0 then do;
set a nobs=n point=i;
output;
end;
end;
stop;
run;
|