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 (April 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 20 Apr 2009 08:17:37 -0500
Reply-To:   "./ ADD NAME=Data _null_;" <iebupdte@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "./ ADD NAME=Data _null_;" <iebupdte@GMAIL.COM>
Subject:   Re: Delete cases where the same ids are involved in different order
Comments:   To: "POHL, Dr., Stefan - AKTUARE" <pohl@aktuare.de>
In-Reply-To:   <FB79E0052ABA4A0C9B31702D896F8218@aktuare.local>
Content-Type:   text/plain; charset=ISO-8859-1

A data step view, CALL SORTC and NODUPKEY. I changed the data type for IDn. Seems like ID would/should be character.

data have; input (id1 id2)(:$4.) dist; cards; 1067 1067 0 1067 1069 2 1067 1097 5 1069 1067 2 1097 1067 5 1154 1156 5 ;;;; run; data haveV / view=haveV; set have; where dist gt 0; call sortC(id1,id2); run; proc sort data=haveV out=need nodupkey; by id:; run; proc print; run;

On 4/20/09, POHL, Dr., Stefan - AKTUARE <pohl@aktuare.de> wrote: > Dear list/ SAS-learner, > > suppose I have this data set: > > data have; > input id1 id2 dist; > cards; > > 1067 1067 0 > 1067 1069 2 > 1067 1097 5 > 1069 1067 2 > 1097 1067 5 > 1154 1156 5 > ;;;;; > run; > > I want to get this data, i.e. I want to delete cases like 1069 1067 as this > is the same case as 1067 1069 with the same distance: > > id1 id2 dist > 1067 1069 2 > 1067 1097 5 > 1154 1156 5 > > How can I solve my problem? > > Stefan. >


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