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 2008, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 28 May 2008 21:59:41 -0700
Reply-To:     KNzaku@GMAIL.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         KNzaku@GMAIL.COM
Organization: http://groups.google.com
Subject:      Merging Datasets
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

Hi, I am trying to merge several datasets but by CROPID and COUNTRY as below. However, I am getting absurd results for two countries (CHILE and NEW ZEALAND). Before sorting the datasets, everything looks fine. After sorting, NEW ZEALAND is replaced with CHILE for a few crops! For these crops CHILE is shown to have two observations (the extra from New Zealand). What am I doing wrong?

Proc sort data=Fruits1989; by cropID country;run; Proc sort data=Fruits1990; by cropID country;run; Proc sort data=Fruits1991; by cropID country;run; Proc sort data=Fruits1992; by cropID country;run; Proc sort data=Fruits1993; by cropID country;run; Proc sort data=Fruits1994; by cropID country;run; Proc sort data=Fruits1995; by cropID country;run; Proc sort data=Fruits1996; by cropID country;run; Proc sort data=Fruits1997; by cropID country;run; Proc sort data=Fruits1998; by cropID country;run; Proc sort data=Fruits1999; by cropID country; run; Proc sort data=Fruits2000; by cropID country; run; Proc sort data=Fruits2001; by cropID country; run; Proc sort data=Fruits2002; by cropID country; run; Proc sort data=Fruits2003; by cropID country; run; Proc sort data=Fruits2004; by cropID country; run; Proc sort data=Fruits2005; by cropID country; run; Proc sort data=Fruits2006; by cropID country; run; Proc sort data=Fruits2007; by cropID country; run;

data mergeFruisQty; merge Fruits1989 Fruits1990 Fruits1991 Fruits1992 Fruits1993 Fruits1994 Fruits1995 Fruits1996 Fruits1997 Fruits1998 Fruits1999 Fruits2000 Fruits2001 Fruits2002 Fruits2003 Fruits2004 Fruits2005 Fruits2006 Fruits2007; by cropid country; run;


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