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 (November 2003, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sat, 22 Nov 2003 17:51:06 GMT
Reply-To:     Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:      Re: Function to select one record in each of multiple subsets of


Like the example, below, I think that a sort with nodupkey will accomplish your task.

Art data one; infile cards truncover ; input ID BeginDate mmddyy10. EndDate mmddyy10.; DateRange = range(BeginDate,EndDate); cards; 1 11/25/1997 01/21/1999 2 12/16/2000 12/20/2001 3 02/21/2000 02/21/2002 4 12/10/1999 12/10/2000 2 10/14/1955 01/12/1998 2 01/01/2002 11/22/2003 3 02/21/1956 02/20/2000 ; run; proc sort data=one out=two; by id descending DateRange; run; proc sort data=two out=three nodupkey; by id; run; ------- "Theodore" <> wrote in message > Hello! > Does anyone know of a way to compare valuss in a specified field among > a subset of records and write to a new file only one record that > satisfies a given criterion (e.g. the longest job duration, among > multiple jobs held by one respondent), and then repeat the process over > a very large number of subsets (e.g. respondents in my example above -- > the has records for jobs held by respondents)? I can't find a SAS > function that can do this, so I am seeking confirmation that it cannot > be done in SAS. Thanks. >

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