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 (June 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 16 Jun 2009 09:07:25 -0400
Reply-To:   msz03@albany.edu
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Mike Zdeb <msz03@ALBANY.EDU>
Subject:   Re: how to obtain last n obs from a sas dataset if we don't know the number of obs..?
Content-Type:   text/plain;charset=iso-8859-1

hi ... OK, more thought ... why read anything but the last N ...

data last; do j=obs-2 to obs; set sashelp.class nobs=obs point=j; output; end; stop; run;

-- Mike Zdeb U@Albany School of Public Health One University Place Rensselaer, New York 12144-3456 P/518-402-6479 F/630-604-1475

> hi ... another way ... last 3 in SASHELP.CLASS > > data last3; > set sashelp.class nobs=obs; > if _n_ ge obs-2; > run; > > ps it is tested > > -- > Mike Zdeb > U@Albany School of Public Health > One University Place > Rensselaer, New York 12144-3456 > P/518-402-6479 F/630-604-1475 > > >> This is untested but >> >> Data naga; >> set naga; >> count+1; >> run; >> Proc sort data = naga out = naga; >> by descending count; >> run; >> Data naga; >> set naga (obs = 15); >> run; >> >> Nat Wooding >> Environmental Specialist III >> Dominion, Environmental Biology >> 4111 Castlewood Rd >> Richmond, VA 23234 >> Phone:804-271-5313, Fax: 804-271-2977 >> Cel Phone: 804-205-0752 >> >> >> >> naga >> <nagabiochem@GMAI >> L.COM> To >> Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU >> Discussion" cc >> <SAS-L@LISTSERV.U >> GA.EDU> Subject >> how to obtain last n obs from a sas >> dataset if we don't know the >> 06/16/2009 08:28 number of obs..? >> AM >> >> >> Please respond to >> naga >> <nagabiochem@GMAI >> L.COM> >> >> >> >> >> >> >> how to obtain last n obs from a sas dataset if we don't know the >> number of obs.. >> >> if we know the num, of obs then we can easily use (first= obs=) but >> what if we don't no number of obs .. >> >> thanks in advance >> >> >> CONFIDENTIALITY NOTICE: This electronic message contains >> information which may be legally confidential and or privileged and >> does not in any case represent a firm ENERGY COMMODITY bid or offer >> relating thereto which binds the sender without an additional >> express written confirmation to that effect. The information is >> intended solely for the individual or entity named above and access >> by anyone else is unauthorized. If you are not the intended >> recipient, any disclosure, copying, distribution, or use of the >> contents of this information is prohibited and may be unlawful. If >> you have received this electronic transmission in error, please >> reply immediately to the sender that you have received the message >> in error, and delete it. Thank you. >> >


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