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 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sun, 2 May 2004 13:41:35 -0700
Reply-To:   sportsfun <sportsfun77@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   sportsfun <sportsfun77@HOTMAIL.COM>
Organization:   http://groups.google.com
Subject:   merge two datasets by id for every year
Content-Type:   text/plain; charset=ISO-8859-1

Hi,

I have two different datasets, for each of the datasets I have the data for each variable for 20 years (in 20 different data files).

I want to merge the two datasets:

DATA ONE; INFILE 'D:\DATA\ANN84.CSV' DLM=',' DSD MISSOVER FIRSTOBS=2; INPUT VAR1 VAR2 VAR3 YEAR ID;

DATA TWO; INFILE 'D:\DATA\EXE84.CSV' DLM=',' DSD MISSOVER FIRSTOBS=2; INPUT VAR1 VAR2 VAR3 YEAR ID;

DATA THREE; MERGE ONE (IN=A) TWO (IN=B); BY ID; IF A AND B; RUN;

I need to do this for every year. Is there some way to run the program just once and get the required results? I just don't like the idea of run the same program over and over again.

Thanks!


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