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 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sat, 6 Sep 2008 07:40:20 -0700
Reply-To:   help4SASnewbie <shopaholic777@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   help4SASnewbie <shopaholic777@GMAIL.COM>
Organization:   http://groups.google.com
Subject:   Keep the last observation only. How?
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset=ISO-8859-1

Hi, I need to keep the last the last end-month value for each FundID. As seen on Table1, some months has 2 or more values, for example Year 88 Month 08 has 0.6665 and 0.6476. The value to keep is the end-month only. Please see table 2 to illustrate desired output.

Table 1: Input FundID Date Value 1 88-08-29 0.6665 1 88-08-31 0.6476 1 88-09-30 0.6257 1 88-10-31 0.6243 1 88-11-14 0.6216 1 88-11-21 0.6204 1 88-11-28 0.5999 1 88-12-31 0.55 3 96-02-19 0.8364 3 96-02-29 0.8364 3 96-03-15 0.8198 3 96-03-29 0.8198 3 96-04-15 0.8289 3 96-04-30 0.8289

Table 2: Desired Output FundID Date Value 1 88-08-31 0.6476 1 88-09-30 0.6257 1 88-10-31 0.6243 1 88-11-28 0.5999 1 88-12-31 0.55 3 96-02-29 0.8364 3 96-03-29 0.8198 3 96-04-30 0.8289

It will be great if you could help with the code to solve this. Many thanks in advance! Ferda - a SAS newbie


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