| Date: | Wed, 21 Sep 2005 22:45:03 +0300 |
| Reply-To: | Vlad <vladislav.moltchanov@KTL.FI> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Vlad <vladislav.moltchanov@KTL.FI> |
| Organization: | KTL (Kansanterveyslaitos) |
| Subject: | Re: Selecting last 10 rows from a dataset |
|
| In-Reply-To: | <1127287423.000092.99240@g47g2000cwa.googlegroups.com> |
| Content-Type: | text/plain; charset=us-ascii; format=flowed |
It could be done in 2 lines:
* generating step:;
data aaa;
do i= 1 to 100;
y=i**2;output;
end; stop;
run;
* selecting last 10 records;
data new; set aaa nobs=nobs;
if _n_>nobs-10;
run;
Proc print;run;
jagadishkr@gmail.com wrote:
> Hi,
>
> Can anyone please expain me the more efficient way to select(Subset)
> last 10 rows of a dataset using datastep and proc SQL ?
>
> Thanks,
> Jaggie
>
|