Date: Fri, 2 Feb 1996 09:48:21 -0500
Reply-To: Jay Goode <JGOODE@QUINTILES.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Jay Goode <JGOODE@QUINTILES.COM>
Subject: Fwd: Error in delivering message.
Unknown user at destination host: darnold@qrtp
Returned message follows:
Error #101 has occurred attempting to deliver a message to
darnold@qrtp
Unknown user at this host, or no path to specified workgroup.
Original Message Follows:
=========================
SMF-70
240Send-to: darnold@qrtp
To: mail@ih (Multiple recipients of list SAS-L) {SAS-L@uga.cc.uga.edu}
202C2-ID: 886C113181C60200
200MCB-options: NNYOANA
Date-posted: 1-Feb-96 19:21:33
220Hop-count: 1
200Message-id: 896C113101C60200
200O-C2-Routed-By: IH; received from -Local-; at 1-Feb-96 19:21:33
X-smtp-file: qfa07783
Date-received: 01-Feb-96 19:20:39 +0500
X-received: uga.cc.uga.edu [128.192.1.5]
Sender: MAIL@IH {owner-sas-l@UGA.CC.UGA.EDU}
Date: 01-Feb-96 14:43:22 -0700
Subject: Re: Stumped with Duplicate Records
Importance: LOW
From: mail@ih (John Beeman) {John_Beeman@NBS.GOV}
Reply-to: mail@ih (John Beeman) {John_Beeman@NBS.GOV}
200MHS-id: 886C113181C60200
200Via-host: IH.IH
200O-C2-Serial-Host: IH
200O-C2-Serial-No: IAANAAACMG
newlin@pcmail.schev.edu asked how to get rid of some duplicate
records
in a student database. The goal is to omit observations with
undeclared majors and then keep only those social security numbers
that have the largest number of credits when there are duplicate ssn
observations.
I think the following code will meet your needs. First, keep only
those with declared majors (you already did), then sort by ssn and
the
number of credits, and sort again by ssn with the nodupkey option.
This will only keep the first observation of ssn , which will be the
one with the largest number of credits. Be sure to sort the credits
variable DESCENDING, because the NODUPKEY option of PROC SORT only
writes the first duplicate observation to the output dataset.
Data tryme; set students ;
where major not in ('und') ;
proc sort ;
by ssn descending credits ;
proc sort nodupkey ;
by ssn ;
run ;