LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2005, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments:   To:
In-Reply-To:   <>
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; 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 >

Back to: Top of message | Previous page | Main SAS-L page