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 (May 1996, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 10 May 1996 13:10:05 -0400
Reply-To:     Clifford Aspinall <CGASPINA@PWINET.UPJ.COM>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Clifford Aspinall <CGASPINA@PWINET.UPJ.COM>
Subject:      Re: Data step programming problem - Help!
Comments: To: Tadd Clayton <t.clayton@AUCKLAND.AC.NZ>

How about something like this:

Proc sort data=original.dataset; by school serial; run;

Data dups; set original.dataset; by school serial; if first.serial and last.serial then delete; run;

============================================================ == Clifford Aspinall cgaspina@pwinet.upj.com (work) === == Kalamazoo, Michigan cgaspina@net-link.net (home) === == Disclaimer: Any opinions expressed are not === == necessarily mine or my employers === ============================================================

______________________________ Reply Separator _________________________________ Subject: Data step programming problem - Help! Author: Tadd Clayton <t.clayton@AUCKLAND.AC.NZ> at INTERNET Date: 5/10/96 3:00 AM

Hi everyone

I have a data set in which each observation should be uniquely identified by a combination of two variables - a school number and a serial number within each school. However, due to problems with the data entry process, there are a number of observations with duplicate values for the combination of school and serial numbers.

I would like to be able to compare the school and serial numbers for each observation with those from the previous observation and then output *both* observations to a data set if they are duplicated. I can use a retain statement to define variables that will carry the school and serial numbers over iterations of the data step to allow the comparison but, as SAS appears to work on an observation by observation basis only, I can't figure out how to output both observations. Can anyone offer a simple solution?

Thanks for any help.

Tadd

-- Tadd Clayton Ph: 64 9 373 7599 ext. 6451 Research Officer Fax: 64 9 373 7486 Department of Paediatrics Email: t.clayton@auckland.ac.nz School of Medicine University of Auckland Private Bag 92019 Auckland NEW ZEALAND


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